From ea42866cf64aa6748758458ba70d94c6fb71deca Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Thu, 24 Aug 2023 00:40:03 +0300 Subject: [PATCH 1/6] Fix Pg array type error, fix ESM imports Closes #1088, closes #1089 --- .eslintrc.yaml | 1 + drizzle-orm/package.json | 2 + drizzle-orm/rollup.cjs.config.ts | 1 + drizzle-orm/rollup.common.ts | 1 + drizzle-orm/rollup.esm.config.ts | 1 + drizzle-orm/scripts/build.ts | 40 +- drizzle-orm/src/alias.ts | 14 +- drizzle-orm/src/aws-data-api/common/index.ts | 2 +- drizzle-orm/src/aws-data-api/pg/driver.ts | 18 +- drizzle-orm/src/aws-data-api/pg/index.ts | 4 +- drizzle-orm/src/aws-data-api/pg/migrator.ts | 6 +- drizzle-orm/src/aws-data-api/pg/session.ts | 16 +- drizzle-orm/src/better-sqlite3/driver.ts | 12 +- drizzle-orm/src/better-sqlite3/index.ts | 4 +- drizzle-orm/src/better-sqlite3/migrator.ts | 6 +- drizzle-orm/src/better-sqlite3/session.ts | 20 +- drizzle-orm/src/bun-sqlite/driver.ts | 12 +- drizzle-orm/src/bun-sqlite/index.ts | 4 +- drizzle-orm/src/bun-sqlite/migrator.ts | 6 +- drizzle-orm/src/bun-sqlite/session.ts | 22 +- drizzle-orm/src/column-builder.ts | 50 +- drizzle-orm/src/column.ts | 10 +- drizzle-orm/src/d1/driver.ts | 12 +- drizzle-orm/src/d1/index.ts | 4 +- drizzle-orm/src/d1/migrator.ts | 6 +- drizzle-orm/src/d1/session.ts | 24 +- drizzle-orm/src/errors.ts | 2 +- drizzle-orm/src/expressions.ts | 2 +- drizzle-orm/src/index.ts | 30 +- drizzle-orm/src/knex/index.ts | 14 +- drizzle-orm/src/kysely/index.ts | 16 +- drizzle-orm/src/libsql/driver.ts | 12 +- drizzle-orm/src/libsql/index.ts | 4 +- drizzle-orm/src/libsql/migrator.ts | 6 +- drizzle-orm/src/libsql/session.ts | 22 +- drizzle-orm/src/logger.ts | 2 +- drizzle-orm/src/mysql-core/alias.ts | 8 +- drizzle-orm/src/mysql-core/checks.ts | 6 +- drizzle-orm/src/mysql-core/columns/bigint.ts | 10 +- drizzle-orm/src/mysql-core/columns/binary.ts | 10 +- drizzle-orm/src/mysql-core/columns/boolean.ts | 10 +- drizzle-orm/src/mysql-core/columns/char.ts | 12 +- drizzle-orm/src/mysql-core/columns/common.ts | 30 +- drizzle-orm/src/mysql-core/columns/custom.ts | 14 +- .../src/mysql-core/columns/date.common.ts | 15 +- drizzle-orm/src/mysql-core/columns/date.ts | 12 +- .../src/mysql-core/columns/datetime.ts | 12 +- drizzle-orm/src/mysql-core/columns/decimal.ts | 10 +- drizzle-orm/src/mysql-core/columns/double.ts | 10 +- drizzle-orm/src/mysql-core/columns/enum.ts | 12 +- drizzle-orm/src/mysql-core/columns/float.ts | 10 +- drizzle-orm/src/mysql-core/columns/index.ts | 50 +- drizzle-orm/src/mysql-core/columns/int.ts | 10 +- drizzle-orm/src/mysql-core/columns/json.ts | 10 +- .../src/mysql-core/columns/mediumint.ts | 10 +- drizzle-orm/src/mysql-core/columns/real.ts | 10 +- drizzle-orm/src/mysql-core/columns/serial.ts | 10 +- .../src/mysql-core/columns/smallint.ts | 10 +- drizzle-orm/src/mysql-core/columns/text.ts | 12 +- drizzle-orm/src/mysql-core/columns/time.ts | 10 +- .../src/mysql-core/columns/timestamp.ts | 12 +- drizzle-orm/src/mysql-core/columns/tinyint.ts | 10 +- .../src/mysql-core/columns/varbinary.ts | 10 +- drizzle-orm/src/mysql-core/columns/varchar.ts | 12 +- drizzle-orm/src/mysql-core/columns/year.ts | 10 +- drizzle-orm/src/mysql-core/db.ts | 32 +- drizzle-orm/src/mysql-core/dialect.ts | 42 +- drizzle-orm/src/mysql-core/expressions.ts | 10 +- drizzle-orm/src/mysql-core/foreign-keys.ts | 6 +- drizzle-orm/src/mysql-core/index.ts | 32 +- drizzle-orm/src/mysql-core/indexes.ts | 8 +- drizzle-orm/src/mysql-core/primary-keys.ts | 6 +- .../src/mysql-core/query-builders/delete.ts | 14 +- .../src/mysql-core/query-builders/index.ts | 12 +- .../src/mysql-core/query-builders/insert.ts | 20 +- .../query-builders/query-builder.ts | 16 +- .../src/mysql-core/query-builders/query.ts | 16 +- .../src/mysql-core/query-builders/select.ts | 39 +- .../mysql-core/query-builders/select.types.ts | 24 +- .../src/mysql-core/query-builders/update.ts | 18 +- drizzle-orm/src/mysql-core/schema.ts | 6 +- drizzle-orm/src/mysql-core/session.ts | 16 +- drizzle-orm/src/mysql-core/subquery.ts | 8 +- drizzle-orm/src/mysql-core/table.ts | 25 +- .../src/mysql-core/unique-constraint.ts | 6 +- drizzle-orm/src/mysql-core/utils.ts | 30 +- drizzle-orm/src/mysql-core/view.ts | 32 +- drizzle-orm/src/mysql2/driver.ts | 24 +- drizzle-orm/src/mysql2/index.ts | 4 +- drizzle-orm/src/mysql2/migrator.ts | 6 +- drizzle-orm/src/mysql2/session.ts | 18 +- drizzle-orm/src/neon-http/driver.ts | 18 +- drizzle-orm/src/neon-http/index.ts | 4 +- drizzle-orm/src/neon-http/migrator.ts | 12 +- drizzle-orm/src/neon-http/session.ts | 26 +- drizzle-orm/src/neon-serverless/driver.ts | 18 +- drizzle-orm/src/neon-serverless/index.ts | 4 +- drizzle-orm/src/neon-serverless/migrator.ts | 6 +- drizzle-orm/src/neon-serverless/session.ts | 22 +- drizzle-orm/src/node-postgres/driver.ts | 18 +- drizzle-orm/src/node-postgres/index.ts | 4 +- drizzle-orm/src/node-postgres/migrator.ts | 6 +- drizzle-orm/src/node-postgres/session.ts | 22 +- drizzle-orm/src/operations.ts | 6 +- drizzle-orm/src/pg-core/alias.ts | 8 +- drizzle-orm/src/pg-core/checks.ts | 6 +- drizzle-orm/src/pg-core/columns/array.ts | 12 +- drizzle-orm/src/pg-core/columns/bigint.ts | 10 +- drizzle-orm/src/pg-core/columns/bigserial.ts | 10 +- drizzle-orm/src/pg-core/columns/boolean.ts | 10 +- drizzle-orm/src/pg-core/columns/char.ts | 12 +- drizzle-orm/src/pg-core/columns/cidr.ts | 10 +- drizzle-orm/src/pg-core/columns/common.ts | 36 +- drizzle-orm/src/pg-core/columns/custom.ts | 14 +- .../src/pg-core/columns/date.common.ts | 8 +- drizzle-orm/src/pg-core/columns/date.ts | 12 +- .../src/pg-core/columns/double-precision.ts | 10 +- drizzle-orm/src/pg-core/columns/enum.ts | 12 +- drizzle-orm/src/pg-core/columns/index.ts | 56 +- drizzle-orm/src/pg-core/columns/inet.ts | 10 +- drizzle-orm/src/pg-core/columns/integer.ts | 10 +- drizzle-orm/src/pg-core/columns/interval.ts | 12 +- drizzle-orm/src/pg-core/columns/json.ts | 10 +- drizzle-orm/src/pg-core/columns/jsonb.ts | 10 +- drizzle-orm/src/pg-core/columns/macaddr.ts | 10 +- drizzle-orm/src/pg-core/columns/macaddr8.ts | 10 +- drizzle-orm/src/pg-core/columns/numeric.ts | 10 +- drizzle-orm/src/pg-core/columns/real.ts | 10 +- drizzle-orm/src/pg-core/columns/serial.ts | 10 +- drizzle-orm/src/pg-core/columns/smallint.ts | 10 +- .../src/pg-core/columns/smallserial.ts | 10 +- drizzle-orm/src/pg-core/columns/text.ts | 12 +- drizzle-orm/src/pg-core/columns/time.ts | 14 +- drizzle-orm/src/pg-core/columns/timestamp.ts | 14 +- drizzle-orm/src/pg-core/columns/uuid.ts | 12 +- drizzle-orm/src/pg-core/columns/varchar.ts | 12 +- drizzle-orm/src/pg-core/db.ts | 50 +- drizzle-orm/src/pg-core/dialect.ts | 34 +- drizzle-orm/src/pg-core/expressions.ts | 10 +- drizzle-orm/src/pg-core/foreign-keys.ts | 6 +- drizzle-orm/src/pg-core/index.ts | 32 +- drizzle-orm/src/pg-core/indexes.ts | 8 +- drizzle-orm/src/pg-core/primary-keys.ts | 6 +- .../src/pg-core/query-builders/delete.ts | 28 +- .../src/pg-core/query-builders/index.ts | 14 +- .../src/pg-core/query-builders/insert.ts | 34 +- .../pg-core/query-builders/query-builder.ts | 20 +- .../src/pg-core/query-builders/query.ts | 18 +- .../refresh-materialized-view.ts | 20 +- .../src/pg-core/query-builders/select.ts | 36 +- .../pg-core/query-builders/select.types.ts | 22 +- .../src/pg-core/query-builders/update.ts | 28 +- drizzle-orm/src/pg-core/schema.ts | 6 +- drizzle-orm/src/pg-core/session.ts | 16 +- drizzle-orm/src/pg-core/subquery.ts | 6 +- drizzle-orm/src/pg-core/table.ts | 25 +- drizzle-orm/src/pg-core/unique-constraint.ts | 6 +- drizzle-orm/src/pg-core/utils.ts | 22 +- drizzle-orm/src/pg-core/view.ts | 40 +- .../src/planetscale-serverless/driver.ts | 16 +- .../src/planetscale-serverless/index.ts | 4 +- .../src/planetscale-serverless/migrator.ts | 6 +- .../src/planetscale-serverless/session.ts | 18 +- drizzle-orm/src/postgres-js/driver.ts | 14 +- drizzle-orm/src/postgres-js/index.ts | 4 +- drizzle-orm/src/postgres-js/migrator.ts | 6 +- drizzle-orm/src/postgres-js/session.ts | 24 +- drizzle-orm/src/primary-key.ts | 6 +- .../src/query-builders/query-builder.ts | 4 +- .../src/query-builders/select.types.ts | 16 +- drizzle-orm/src/query-promise.ts | 2 +- drizzle-orm/src/relations.ts | 12 +- drizzle-orm/src/sql-js/driver.ts | 12 +- drizzle-orm/src/sql-js/index.ts | 4 +- drizzle-orm/src/sql-js/migrator.ts | 6 +- drizzle-orm/src/sql-js/session.ts | 22 +- drizzle-orm/src/sql/expressions/conditions.ts | 10 +- drizzle-orm/src/sql/expressions/index.ts | 4 +- drizzle-orm/src/sql/expressions/select.ts | 6 +- drizzle-orm/src/sql/index.ts | 20 +- drizzle-orm/src/sqlite-core/alias.ts | 8 +- drizzle-orm/src/sqlite-core/checks.ts | 6 +- drizzle-orm/src/sqlite-core/columns/blob.ts | 12 +- drizzle-orm/src/sqlite-core/columns/common.ts | 34 +- drizzle-orm/src/sqlite-core/columns/custom.ts | 14 +- drizzle-orm/src/sqlite-core/columns/index.ts | 14 +- .../src/sqlite-core/columns/integer.ts | 16 +- .../src/sqlite-core/columns/numeric.ts | 10 +- drizzle-orm/src/sqlite-core/columns/real.ts | 10 +- drizzle-orm/src/sqlite-core/columns/text.ts | 12 +- drizzle-orm/src/sqlite-core/db.ts | 32 +- drizzle-orm/src/sqlite-core/dialect.ts | 36 +- drizzle-orm/src/sqlite-core/expressions.ts | 10 +- drizzle-orm/src/sqlite-core/foreign-keys.ts | 6 +- drizzle-orm/src/sqlite-core/index.ts | 30 +- drizzle-orm/src/sqlite-core/indexes.ts | 8 +- drizzle-orm/src/sqlite-core/primary-keys.ts | 6 +- .../src/sqlite-core/query-builders/delete.ts | 20 +- .../src/sqlite-core/query-builders/index.ts | 12 +- .../src/sqlite-core/query-builders/insert.ts | 26 +- .../query-builders/query-builder.ts | 16 +- .../src/sqlite-core/query-builders/query.ts | 16 +- .../src/sqlite-core/query-builders/select.ts | 34 +- .../query-builders/select.types.ts | 22 +- .../src/sqlite-core/query-builders/update.ts | 22 +- drizzle-orm/src/sqlite-core/session.ts | 16 +- drizzle-orm/src/sqlite-core/subquery.ts | 6 +- drizzle-orm/src/sqlite-core/table.ts | 25 +- .../src/sqlite-core/unique-constraint.ts | 6 +- drizzle-orm/src/sqlite-core/utils.ts | 28 +- drizzle-orm/src/sqlite-core/view.ts | 30 +- drizzle-orm/src/sqlite-proxy/driver.ts | 12 +- drizzle-orm/src/sqlite-proxy/index.ts | 4 +- drizzle-orm/src/sqlite-proxy/migrator.ts | 8 +- drizzle-orm/src/sqlite-proxy/session.ts | 24 +- drizzle-orm/src/subquery.ts | 10 +- drizzle-orm/src/table.ts | 57 +- drizzle-orm/src/tracing.ts | 4 +- drizzle-orm/src/utils.ts | 22 +- drizzle-orm/src/vercel-postgres/driver.ts | 16 +- drizzle-orm/src/vercel-postgres/index.ts | 4 +- drizzle-orm/src/vercel-postgres/migrator.ts | 6 +- drizzle-orm/src/vercel-postgres/session.ts | 18 +- drizzle-orm/src/view.ts | 10 +- drizzle-orm/tests/is.test.ts | 2 +- drizzle-orm/tests/makePgArray.test.ts | 2 +- drizzle-orm/tests/parsePgArray.test.ts | 2 +- drizzle-orm/tsconfig.build.json | 17 + drizzle-orm/tsconfig.cjs.json | 5 +- drizzle-orm/tsconfig.config.json | 7 + drizzle-orm/tsconfig.dts.json | 10 +- drizzle-orm/tsconfig.esm.json | 2 +- drizzle-orm/tsconfig.json | 16 +- drizzle-orm/type-tests/knex/index.ts | 12 +- drizzle-orm/type-tests/kysely/index.ts | 13 +- drizzle-orm/type-tests/mysql/1-to-1-fk.ts | 4 +- drizzle-orm/type-tests/mysql/1000columns.ts | 2 +- drizzle-orm/type-tests/mysql/db-rel.ts | 8 +- drizzle-orm/type-tests/mysql/db.ts | 2 +- drizzle-orm/type-tests/mysql/delete.ts | 12 +- drizzle-orm/type-tests/mysql/insert.ts | 14 +- drizzle-orm/type-tests/mysql/select.ts | 17 +- drizzle-orm/type-tests/mysql/subquery.ts | 12 +- drizzle-orm/type-tests/mysql/tables-rel.ts | 4 +- drizzle-orm/type-tests/mysql/tables.ts | 19 +- drizzle-orm/type-tests/mysql/with.ts | 12 +- drizzle-orm/type-tests/pg/1-to-1-fk.ts | 4 +- drizzle-orm/type-tests/pg/array.ts | 6 +- drizzle-orm/type-tests/pg/db-rel.ts | 14 +- drizzle-orm/type-tests/pg/db.ts | 2 +- drizzle-orm/type-tests/pg/delete.ts | 15 +- drizzle-orm/type-tests/pg/insert.ts | 15 +- drizzle-orm/type-tests/pg/other.ts | 12 +- drizzle-orm/type-tests/pg/select.ts | 41 +- drizzle-orm/type-tests/pg/subquery.ts | 12 +- drizzle-orm/type-tests/pg/tables-rel.ts | 4 +- drizzle-orm/type-tests/pg/tables.ts | 22 +- drizzle-orm/type-tests/pg/update.ts | 10 +- drizzle-orm/type-tests/pg/with.ts | 12 +- drizzle-orm/type-tests/sqlite/db.ts | 6 +- drizzle-orm/type-tests/sqlite/delete.ts | 21 +- drizzle-orm/type-tests/sqlite/insert.ts | 31 +- drizzle-orm/type-tests/sqlite/other.ts | 12 +- drizzle-orm/type-tests/sqlite/select.ts | 31 +- drizzle-orm/type-tests/sqlite/subquery.ts | 12 +- drizzle-orm/type-tests/sqlite/tables.ts | 27 +- drizzle-orm/type-tests/sqlite/update.ts | 21 +- drizzle-orm/type-tests/sqlite/with.ts | 12 +- drizzle-orm/type-tests/tsconfig.json | 3 +- drizzle-typebox/package.json | 16 +- drizzle-typebox/scripts/build.ts | 17 + drizzle-typebox/tests/mysql.test.ts | 37 +- drizzle-typebox/tests/pg.test.ts | 28 +- drizzle-typebox/tests/sqlite.test.ts | 34 +- drizzle-valibot/package.json | 16 +- drizzle-valibot/scripts/build.ts | 17 + drizzle-valibot/tests/mysql.test.ts | 22 +- drizzle-valibot/tests/pg.test.ts | 44 +- drizzle-valibot/tests/sqlite.test.ts | 35 +- drizzle-zod/package.json | 16 +- drizzle-zod/scripts/build.ts | 17 + drizzle-zod/tests/sqlite.test.ts | 1 - integration-tests/package.json | 3 + integration-tests/tests/better-sqlite.test.ts | 2 +- integration-tests/tests/d1.test.ts | 2 +- integration-tests/tests/imports.test.cjs | 12 +- integration-tests/tests/libsql.test.ts | 6 +- .../tests/mysql.prefixed.test.ts | 2 +- integration-tests/tests/mysql.test.ts | 2 +- integration-tests/tests/neon-http.test.ts | 2 +- integration-tests/tests/pg.test.ts | 4 +- integration-tests/tests/postgres.js.test.ts | 2 +- .../tests/relational/bettersqlite.test.ts | 2 +- integration-tests/tests/relational/db.ts | 2 +- .../duplicates/mysql/mysql.duplicates.test.ts | 2 +- .../duplicates/pg/pg.duplicates.test.ts | 2 +- .../issues-schemas/wrong-mapping/pg.test.ts | 2 +- .../relational/mysql.planetscale.test.ts | 2 +- .../tests/relational/mysql.test.ts | 2 +- .../tests/relational/pg.postgresjs.test.ts | 2 +- integration-tests/tests/relational/pg.test.ts | 2 +- .../tests/relational/turso.test.ts | 2 +- .../tests/relational/vercel.test.ts | 2 +- integration-tests/tests/sql.js.test.ts | 2 +- integration-tests/tests/vercel-pg.test.ts | 2 +- integration-tests/tsconfig.json | 4 +- package.json | 34 +- ...ipt@5.1.3.patch => typescript@5.1.6.patch} | 2 +- pnpm-lock.yaml | 1363 ++++++++++------- 309 files changed, 3052 insertions(+), 2517 deletions(-) create mode 100644 drizzle-orm/tsconfig.build.json create mode 100644 drizzle-orm/tsconfig.config.json create mode 100755 drizzle-typebox/scripts/build.ts create mode 100755 drizzle-valibot/scripts/build.ts create mode 100755 drizzle-zod/scripts/build.ts rename patches/{typescript@5.1.3.patch => typescript@5.1.6.patch} (83%) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index fa73328d7..c45b9d1d3 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -64,3 +64,4 @@ rules: 'unicorn/prefer-string-replace-all': 'off' 'unicorn/no-process-exit': 'off' '@typescript-eslint/ban-ts-comment': 'off' + '@typescript-eslint/no-empty-interface': 'off' diff --git a/drizzle-orm/package.json b/drizzle-orm/package.json index ff97ef28e..a4e4a441c 100644 --- a/drizzle-orm/package.json +++ b/drizzle-orm/package.json @@ -141,6 +141,7 @@ "better-sqlite3": "^8.4.0", "bun-types": "^0.6.6", "concurrently": "^8.1.0", + "cpy": "^10.1.0", "cpy-cli": "^5.0.0", "knex": "^2.4.2", "kysely": "^0.25.0", @@ -150,6 +151,7 @@ "rimraf": "^5.0.0", "rollup": "^3.27.2", "rollup-plugin-dts": "^5.3.1", + "rollup-plugin-typescript2": "^0.35.0", "sql.js": "^1.8.0", "sqlite3": "^5.1.2", "tslib": "^2.5.2", diff --git a/drizzle-orm/rollup.cjs.config.ts b/drizzle-orm/rollup.cjs.config.ts index ba7164d67..52f7b959e 100644 --- a/drizzle-orm/rollup.cjs.config.ts +++ b/drizzle-orm/rollup.cjs.config.ts @@ -2,6 +2,7 @@ import json from '@rollup/plugin-json'; import replace from '@rollup/plugin-replace'; import typescript from '@rollup/plugin-typescript'; import { defineConfig } from 'rollup'; + import { entries, external } from './rollup.common'; export default defineConfig([ diff --git a/drizzle-orm/rollup.common.ts b/drizzle-orm/rollup.common.ts index 113bacff2..741c1c38f 100644 --- a/drizzle-orm/rollup.common.ts +++ b/drizzle-orm/rollup.common.ts @@ -50,6 +50,7 @@ export const external = [ 'knex', 'kysely', 'mysql2', + 'mysql2/promise', 'postgres', 'sqlite3', 'bun:sqlite', diff --git a/drizzle-orm/rollup.esm.config.ts b/drizzle-orm/rollup.esm.config.ts index c9ae38684..4b3a04910 100644 --- a/drizzle-orm/rollup.esm.config.ts +++ b/drizzle-orm/rollup.esm.config.ts @@ -1,6 +1,7 @@ import json from '@rollup/plugin-json'; import typescript from '@rollup/plugin-typescript'; import { defineConfig } from 'rollup'; + import { entries, external } from './rollup.common'; export default defineConfig([ diff --git a/drizzle-orm/scripts/build.ts b/drizzle-orm/scripts/build.ts index 7170886dc..3af0d4259 100755 --- a/drizzle-orm/scripts/build.ts +++ b/drizzle-orm/scripts/build.ts @@ -1,22 +1,41 @@ #!/usr/bin/env -S pnpm tsx import 'zx/globals'; import concurrently from 'concurrently'; +import cpy from 'cpy'; import { entries } from '../rollup.common'; function updateAndCopyPackageJson() { const pkg = fs.readJSONSync('package.json'); - pkg.exports = entries.reduce>( + pkg.exports = entries.reduce< + Record + >( (acc, entry) => { const exportsEntry = entry === 'index' ? '.' : './' + entry.replace(/\/index$/, ''); const importEntry = `./${entry}.mjs`; const requireEntry = `./${entry}.cjs`; - const typesEntry = `./${entry}.d.ts`; acc[exportsEntry] = { - types: typesEntry, - import: importEntry, - require: requireEntry, + import: { + types: `./${entry}.d.mts`, + default: importEntry, + }, + require: { + types: `./${entry}.d.cts`, + default: requireEntry, + }, + types: `./${entry}.d.ts`, default: importEntry, }; return acc; @@ -37,13 +56,20 @@ await concurrently([ name: 'esm', }, { - command: - `rimraf dist-dts && tsc -p tsconfig.dts.json --declaration --outDir dist-dts --emitDeclarationOnly && resolve-tspaths --out dist-dts && cpy 'dist-dts/**/*' dist.new && rimraf dist-dts`, + command: `rimraf dist-dts && tsc -p tsconfig.dts.json && resolve-tspaths -p tsconfig.dts.json --out dist-dts`, name: 'dts', }, ], { killOthers: 'failure', }).result.catch(() => process.exit(1)); +await cpy('dist-dts/**/*.d.ts', 'dist.new', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), +}); +await cpy('dist-dts/**/*.d.ts', 'dist.new', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), +}); +await cpy('dist-dts/**/*.d.ts', 'dist.new'); +fs.removeSync('dist-dts'); fs.copySync('../README.md', 'dist.new/README.md'); updateAndCopyPackageJson(); fs.removeSync('dist'); diff --git a/drizzle-orm/src/alias.ts b/drizzle-orm/src/alias.ts index c088e9da4..e570921d2 100644 --- a/drizzle-orm/src/alias.ts +++ b/drizzle-orm/src/alias.ts @@ -1,10 +1,10 @@ -import type { AnyColumn } from './column'; -import { Column } from './column'; -import { entityKind, is } from './entity'; -import type { Relation } from './relations'; -import { SQL, sql } from './sql'; -import { Table } from './table'; -import { type View, ViewBaseConfig } from './view'; +import type { AnyColumn } from './column.ts'; +import { Column } from './column.ts'; +import { entityKind, is } from './entity.ts'; +import type { Relation } from './relations.ts'; +import { SQL, sql } from './sql/index.ts'; +import { Table } from './table.ts'; +import { type View, ViewBaseConfig } from './view.ts'; export class ColumnAliasProxyHandler implements ProxyHandler { static readonly [entityKind]: string = 'ColumnAliasProxyHandler'; diff --git a/drizzle-orm/src/aws-data-api/common/index.ts b/drizzle-orm/src/aws-data-api/common/index.ts index b909f6a6a..805011941 100644 --- a/drizzle-orm/src/aws-data-api/common/index.ts +++ b/drizzle-orm/src/aws-data-api/common/index.ts @@ -1,6 +1,6 @@ import type { Field } from '@aws-sdk/client-rds-data'; import { TypeHint } from '@aws-sdk/client-rds-data'; -import type { QueryTypingsValue } from '~/sql'; +import type { QueryTypingsValue } from '~/sql/index.ts'; export function getValueFromDataApi(field: Field) { if (field.stringValue !== undefined) { diff --git a/drizzle-orm/src/aws-data-api/pg/driver.ts b/drizzle-orm/src/aws-data-api/pg/driver.ts index f14c53402..dac77b54d 100644 --- a/drizzle-orm/src/aws-data-api/pg/driver.ts +++ b/drizzle-orm/src/aws-data-api/pg/driver.ts @@ -1,17 +1,17 @@ -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { PgDatabase } from '~/pg-core/db'; -import { PgDialect } from '~/pg-core/dialect'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { PgDatabase } from '~/pg-core/db.ts'; +import { PgDialect } from '~/pg-core/dialect.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import type { AwsDataApiClient, AwsDataApiPgQueryResultHKT } from './session'; -import { AwsDataApiSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import type { AwsDataApiClient, AwsDataApiPgQueryResultHKT } from './session.ts'; +import { AwsDataApiSession } from './session.ts'; export interface PgDriverOptions { logger?: Logger; diff --git a/drizzle-orm/src/aws-data-api/pg/index.ts b/drizzle-orm/src/aws-data-api/pg/index.ts index dab649b2b..b1b6a52e7 100644 --- a/drizzle-orm/src/aws-data-api/pg/index.ts +++ b/drizzle-orm/src/aws-data-api/pg/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; \ No newline at end of file +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/aws-data-api/pg/migrator.ts b/drizzle-orm/src/aws-data-api/pg/migrator.ts index d4aef70f1..01fa55050 100644 --- a/drizzle-orm/src/aws-data-api/pg/migrator.ts +++ b/drizzle-orm/src/aws-data-api/pg/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { AwsDataApiPgDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { AwsDataApiPgDatabase } from './driver.ts'; export async function migrate>( db: AwsDataApiPgDatabase, diff --git a/drizzle-orm/src/aws-data-api/pg/session.ts b/drizzle-orm/src/aws-data-api/pg/session.ts index 8aab010c7..97d3dd3c0 100644 --- a/drizzle-orm/src/aws-data-api/pg/session.ts +++ b/drizzle-orm/src/aws-data-api/pg/session.ts @@ -5,8 +5,8 @@ import { ExecuteStatementCommand, RollbackTransactionCommand, } from '@aws-sdk/client-rds-data'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; import { type PgDialect, PgSession, @@ -15,12 +15,12 @@ import { PreparedQuery, type PreparedQueryConfig, type QueryResultHKT, -} from '~/pg-core'; -import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, type QueryTypingsValue, type SQL, sql } from '~/sql'; -import { mapResultRow } from '~/utils'; -import { getValueFromDataApi, toValueParam } from '../common'; +} from '~/pg-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, type QueryTypingsValue, type SQL, sql } from '~/sql/index.ts'; +import { mapResultRow } from '~/utils.ts'; +import { getValueFromDataApi, toValueParam } from '../common/index.ts'; export type AwsDataApiClient = RDSDataClient; diff --git a/drizzle-orm/src/better-sqlite3/driver.ts b/drizzle-orm/src/better-sqlite3/driver.ts index 214bcf6a3..ac2c7db0a 100644 --- a/drizzle-orm/src/better-sqlite3/driver.ts +++ b/drizzle-orm/src/better-sqlite3/driver.ts @@ -1,15 +1,15 @@ import type { Database, RunResult } from 'better-sqlite3'; -import { DefaultLogger } from '~/logger'; +import { DefaultLogger } from '~/logger.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { BaseSQLiteDatabase } from '~/sqlite-core/db'; -import { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import { type DrizzleConfig } from '~/utils'; -import { BetterSQLiteSession } from './session'; +} from '~/relations.ts'; +import { BaseSQLiteDatabase } from '~/sqlite-core/db.ts'; +import { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { BetterSQLiteSession } from './session.ts'; export type BetterSQLite3Database< TSchema extends Record = Record, diff --git a/drizzle-orm/src/better-sqlite3/index.ts b/drizzle-orm/src/better-sqlite3/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/better-sqlite3/index.ts +++ b/drizzle-orm/src/better-sqlite3/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/better-sqlite3/migrator.ts b/drizzle-orm/src/better-sqlite3/migrator.ts index 14802b62c..29fe41768 100644 --- a/drizzle-orm/src/better-sqlite3/migrator.ts +++ b/drizzle-orm/src/better-sqlite3/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { BetterSQLite3Database } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { BetterSQLite3Database } from './driver.ts'; export function migrate>( db: BetterSQLite3Database, diff --git a/drizzle-orm/src/better-sqlite3/session.ts b/drizzle-orm/src/better-sqlite3/session.ts index 863e7385d..74be6830b 100644 --- a/drizzle-orm/src/better-sqlite3/session.ts +++ b/drizzle-orm/src/better-sqlite3/session.ts @@ -1,20 +1,20 @@ import type { Database, RunResult, Statement } from 'better-sqlite3'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { SQLiteTransaction } from '~/sqlite-core'; -import type { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import type { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { SQLiteTransaction } from '~/sqlite-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts'; import { PreparedQuery as PreparedQueryBase, type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteExecuteMethod, SQLiteSession, type SQLiteTransactionConfig, -} from '~/sqlite-core/session'; -import { mapResultRow } from '~/utils'; +} from '~/sqlite-core/session.ts'; +import { mapResultRow } from '~/utils.ts'; export interface BetterSQLiteSessionOptions { logger?: Logger; diff --git a/drizzle-orm/src/bun-sqlite/driver.ts b/drizzle-orm/src/bun-sqlite/driver.ts index 69af72483..36d500748 100644 --- a/drizzle-orm/src/bun-sqlite/driver.ts +++ b/drizzle-orm/src/bun-sqlite/driver.ts @@ -1,17 +1,17 @@ /// import type { Database } from 'bun:sqlite'; -import { DefaultLogger } from '~/logger'; +import { DefaultLogger } from '~/logger.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { BaseSQLiteDatabase } from '~/sqlite-core/db'; -import { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import { type DrizzleConfig } from '~/utils'; -import { SQLiteBunSession } from './session'; +} from '~/relations.ts'; +import { BaseSQLiteDatabase } from '~/sqlite-core/db.ts'; +import { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { SQLiteBunSession } from './session.ts'; export type BunSQLiteDatabase< TSchema extends Record = Record, diff --git a/drizzle-orm/src/bun-sqlite/index.ts b/drizzle-orm/src/bun-sqlite/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/bun-sqlite/index.ts +++ b/drizzle-orm/src/bun-sqlite/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/bun-sqlite/migrator.ts b/drizzle-orm/src/bun-sqlite/migrator.ts index 4e9c17506..986649b04 100644 --- a/drizzle-orm/src/bun-sqlite/migrator.ts +++ b/drizzle-orm/src/bun-sqlite/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { BunSQLiteDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { BunSQLiteDatabase } from './driver.ts'; export function migrate>( db: BunSQLiteDatabase, diff --git a/drizzle-orm/src/bun-sqlite/session.ts b/drizzle-orm/src/bun-sqlite/session.ts index 30151ad93..816b1ab06 100644 --- a/drizzle-orm/src/bun-sqlite/session.ts +++ b/drizzle-orm/src/bun-sqlite/session.ts @@ -1,21 +1,21 @@ /// import type { Database, Statement as BunStatement } from 'bun:sqlite'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { SQLiteTransaction } from '~/sqlite-core'; -import type { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import type { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { SQLiteTransaction } from '~/sqlite-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts'; import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig, -} from '~/sqlite-core/session'; -import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session'; -import { mapResultRow } from '~/utils'; +} from '~/sqlite-core/session.ts'; +import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session.ts'; +import { mapResultRow } from '~/utils.ts'; export interface SQLiteBunSessionOptions { logger?: Logger; diff --git a/drizzle-orm/src/column-builder.ts b/drizzle-orm/src/column-builder.ts index d1ec25ecd..5adce6e73 100644 --- a/drizzle-orm/src/column-builder.ts +++ b/drizzle-orm/src/column-builder.ts @@ -1,9 +1,10 @@ -import { entityKind } from '~/entity'; -import type { Column } from './column'; -import type { MySqlColumn } from './mysql-core'; -import type { PgColumn } from './pg-core'; -import type { SQL } from './sql'; -import type { SQLiteColumn } from './sqlite-core'; +import { entityKind } from '~/entity.ts'; +import type { Column } from './column.ts'; +import type { MySqlColumn } from './mysql-core/index.ts'; +import type { PgColumn } from './pg-core/index.ts'; +import type { SQL } from './sql/index.ts'; +import type { SQLiteColumn } from './sqlite-core/index.ts'; +import type { Simplify } from './utils.ts'; export type ColumnDataType = | 'string' @@ -40,14 +41,15 @@ export type MakeColumnConfig< notNull: T extends { notNull: true } ? true : false; hasDefault: T extends { hasDefault: true } ? true : false; enumValues: T['enumValues']; - baseColumn: T extends { baseBuilder: infer U extends ColumnBuilder } ? BuildColumn + baseColumn: T extends { baseBuilder: infer U extends ColumnBuilderBase } ? BuildColumn : never; } & {}; export type ColumnBuilderTypeConfig< + // eslint-disable-next-line @typescript-eslint/no-unused-vars T extends ColumnBuilderBaseConfig, TTypeConfig extends object = object, -> = +> = Simplify< & { brand: 'ColumnBuilder'; name: T['name']; @@ -59,7 +61,8 @@ export type ColumnBuilderTypeConfig< hasDefault: T extends { hasDefault: infer U } ? U : boolean; enumValues: T['enumValues']; } - & TTypeConfig; + & TTypeConfig +>; export type ColumnBuilderRuntimeConfig = { name: string; @@ -79,33 +82,38 @@ export interface ColumnBuilderExtraConfig { primaryKeyHasDefault?: boolean; } -export type NotNull = T & { +export type NotNull = T & { _: { notNull: true; }; }; -export type HasDefault = T & { +export type HasDefault = T & { _: { hasDefault: true; }; }; -export type $Type = T & { +export type $Type = T & { _: { $type: TType; }; }; +export interface ColumnBuilderBase< + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, + TTypeConfig extends object = object, +> { + _: ColumnBuilderTypeConfig; +} + // To understand how to use `ColumnBuilder` and `AnyColumnBuilder`, see `Column` and `AnyColumn` documentation. export abstract class ColumnBuilder< - T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig & { - data: any; - }, + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig, -> { +> implements ColumnBuilderBase { static readonly [entityKind]: string = 'ColumnBuilder'; declare _: ColumnBuilderTypeConfig; @@ -159,7 +167,7 @@ export abstract class ColumnBuilder< * * If you need to set a dynamic default value, use {@link $defaultFn} instead. */ - default(value: (this['_'] extends { $type: infer U } ? U : T['data']) | SQL): HasDefault { + default(value: (this['_'] extends { $type: infer U } ? U : this['_']['data']) | SQL): HasDefault { this.config.default = value; this.config.hasDefault = true; return this as HasDefault; @@ -171,7 +179,9 @@ export abstract class ColumnBuilder< * * **Note:** This value does not affect the `drizzle-kit` behavior, it is only used at runtime in `drizzle-orm`. */ - $defaultFn(fn: () => (this['_'] extends { $type: infer U } ? U : T['data']) | SQL): HasDefault { + $defaultFn( + fn: () => (this['_'] extends { $type: infer U } ? U : this['_']['data']) | SQL, + ): HasDefault { this.config.defaultFn = fn; this.config.hasDefault = true; return this as HasDefault; @@ -196,7 +206,7 @@ export abstract class ColumnBuilder< export type BuildColumn< TTableName extends string, - TBuilder extends ColumnBuilder, + TBuilder extends ColumnBuilderBase, TDialect extends Dialect, > = TDialect extends 'pg' ? PgColumn> : TDialect extends 'mysql' ? MySqlColumn> @@ -206,7 +216,7 @@ export type BuildColumn< export type BuildColumns< TTableName extends string, - TConfigMap extends Record, + TConfigMap extends Record, TDialect extends Dialect, > = & { diff --git a/drizzle-orm/src/column.ts b/drizzle-orm/src/column.ts index d636efaa4..836d32700 100644 --- a/drizzle-orm/src/column.ts +++ b/drizzle-orm/src/column.ts @@ -1,8 +1,8 @@ -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, ColumnDataType } from './column-builder'; -import { entityKind } from './entity'; -import type { DriverValueMapper, SQL, SQLWrapper } from './sql'; -import type { Table } from './table'; -import type { Update } from './utils'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, ColumnDataType } from './column-builder.ts'; +import { entityKind } from './entity.ts'; +import type { DriverValueMapper, SQL, SQLWrapper } from './sql/index.ts'; +import type { Table } from './table.ts'; +import type { Update } from './utils.ts'; export interface ColumnBaseConfig< TDataType extends ColumnDataType, diff --git a/drizzle-orm/src/d1/driver.ts b/drizzle-orm/src/d1/driver.ts index 045ef0f58..e4f32109e 100644 --- a/drizzle-orm/src/d1/driver.ts +++ b/drizzle-orm/src/d1/driver.ts @@ -1,16 +1,16 @@ /// -import { DefaultLogger } from '~/logger'; +import { DefaultLogger } from '~/logger.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { BaseSQLiteDatabase } from '~/sqlite-core/db'; -import { SQLiteAsyncDialect } from '~/sqlite-core/dialect'; -import { type DrizzleConfig } from '~/utils'; -import { SQLiteD1Session } from './session'; +} from '~/relations.ts'; +import { BaseSQLiteDatabase } from '~/sqlite-core/db.ts'; +import { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { SQLiteD1Session } from './session.ts'; export type DrizzleD1Database< TSchema extends Record = Record, diff --git a/drizzle-orm/src/d1/index.ts b/drizzle-orm/src/d1/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/d1/index.ts +++ b/drizzle-orm/src/d1/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/d1/migrator.ts b/drizzle-orm/src/d1/migrator.ts index c6465d88e..16fac86c2 100644 --- a/drizzle-orm/src/d1/migrator.ts +++ b/drizzle-orm/src/d1/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { DrizzleD1Database } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { DrizzleD1Database } from './driver.ts'; export async function migrate>( db: DrizzleD1Database, diff --git a/drizzle-orm/src/d1/session.ts b/drizzle-orm/src/d1/session.ts index f4dae3ac7..d45731764 100644 --- a/drizzle-orm/src/d1/session.ts +++ b/drizzle-orm/src/d1/session.ts @@ -1,21 +1,21 @@ /// -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { type Query, sql } from '~/sql'; -import { fillPlaceholders } from '~/sql'; -import { SQLiteTransaction } from '~/sqlite-core'; -import type { SQLiteAsyncDialect } from '~/sqlite-core/dialect'; -import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { type Query, sql } from '~/sql/index.ts'; +import { fillPlaceholders } from '~/sql/index.ts'; +import type { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts'; +import { SQLiteTransaction } from '~/sqlite-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts'; import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteExecuteMethod, type SQLiteTransactionConfig, -} from '~/sqlite-core/session'; -import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session'; -import { mapResultRow } from '~/utils'; +} from '~/sqlite-core/session.ts'; +import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session.ts'; +import { mapResultRow } from '~/utils.ts'; export interface SQLiteD1SessionOptions { logger?: Logger; diff --git a/drizzle-orm/src/errors.ts b/drizzle-orm/src/errors.ts index bb255c616..151264c68 100644 --- a/drizzle-orm/src/errors.ts +++ b/drizzle-orm/src/errors.ts @@ -1,4 +1,4 @@ -import { entityKind } from '~/entity'; +import { entityKind } from '~/entity.ts'; export class DrizzleError extends Error { static readonly [entityKind]: string = 'DrizzleError'; diff --git a/drizzle-orm/src/expressions.ts b/drizzle-orm/src/expressions.ts index 09340ed76..f1a3ec4ce 100644 --- a/drizzle-orm/src/expressions.ts +++ b/drizzle-orm/src/expressions.ts @@ -1 +1 @@ -export * from './sql/expressions'; +export * from './sql/expressions/index.ts'; diff --git a/drizzle-orm/src/index.ts b/drizzle-orm/src/index.ts index 0b2494527..2eb9a58ca 100644 --- a/drizzle-orm/src/index.ts +++ b/drizzle-orm/src/index.ts @@ -1,15 +1,15 @@ -export * from './alias'; -export * from './column'; -export * from './column-builder'; -export * from './entity'; -export * from './errors'; -export * from './expressions'; -export * from './logger'; -export * from './operations'; -export * from './query-promise'; -export * from './relations'; -export * from './sql'; -export * from './subquery'; -export * from './table'; -export * from './utils'; -export * from './view'; +export * from './alias.ts'; +export * from './column-builder.ts'; +export * from './column.ts'; +export * from './entity.ts'; +export * from './errors.ts'; +export * from './expressions.ts'; +export * from './logger.ts'; +export * from './operations.ts'; +export * from './query-promise.ts'; +export * from './relations.ts'; +export * from './sql/index.ts'; +export * from './subquery.ts'; +export * from './table.ts'; +export * from './utils.ts'; +export * from './view.ts'; diff --git a/drizzle-orm/src/knex/index.ts b/drizzle-orm/src/knex/index.ts index ec00ce10b..9aa5e8854 100644 --- a/drizzle-orm/src/knex/index.ts +++ b/drizzle-orm/src/knex/index.ts @@ -1,9 +1,11 @@ import type { Knex as KnexType } from 'knex'; -import type { InferModel, Table } from '~/table'; +import type { InferInsertModel, InferSelectModel, Table } from '~/table.ts'; -declare module 'knex/types/tables' { - export type Knexify = KnexType.CompositeTableType< - InferModel, - InferModel - >; +declare module 'knex/types/tables.ts' { + export type Knexify = + & KnexType.CompositeTableType< + InferSelectModel, + InferInsertModel + > + & {}; } diff --git a/drizzle-orm/src/kysely/index.ts b/drizzle-orm/src/kysely/index.ts index 09037052c..45703e72f 100644 --- a/drizzle-orm/src/kysely/index.ts +++ b/drizzle-orm/src/kysely/index.ts @@ -1,25 +1,23 @@ import type { ColumnType } from 'kysely'; -import type { InferModel, MapColumnName, Table } from '~/table'; -import type { Simplify } from '~/utils'; +import type { InferInsertModel, InferSelectModel, MapColumnName, Table } from '~/table.ts'; +import type { Simplify } from '~/utils.ts'; export type Kyselify = Simplify< { [Key in keyof T['_']['columns'] & string as MapColumnName]: ColumnType< // select - InferModel[MapColumnName], + InferSelectModel[MapColumnName], // insert - MapColumnName extends keyof InferModel< + MapColumnName extends keyof InferInsertModel< T, - 'insert', { dbColumnNames: true } - > ? InferModel[MapColumnName] + > ? InferInsertModel[MapColumnName] : never, // update - MapColumnName extends keyof InferModel< + MapColumnName extends keyof InferInsertModel< T, - 'insert', { dbColumnNames: true } - > ? InferModel[MapColumnName] + > ? InferInsertModel[MapColumnName] : never >; } diff --git a/drizzle-orm/src/libsql/driver.ts b/drizzle-orm/src/libsql/driver.ts index 385c0a01c..2d47a52a8 100644 --- a/drizzle-orm/src/libsql/driver.ts +++ b/drizzle-orm/src/libsql/driver.ts @@ -1,15 +1,15 @@ import type { Client, ResultSet } from '@libsql/client'; -import { DefaultLogger } from '~/logger'; +import { DefaultLogger } from '~/logger.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { BaseSQLiteDatabase } from '~/sqlite-core/db'; -import { SQLiteAsyncDialect } from '~/sqlite-core/dialect'; -import { type DrizzleConfig } from '~/utils'; -import { LibSQLSession } from './session'; +} from '~/relations.ts'; +import { BaseSQLiteDatabase } from '~/sqlite-core/db.ts'; +import { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { LibSQLSession } from './session.ts'; export type LibSQLDatabase< TSchema extends Record = Record, diff --git a/drizzle-orm/src/libsql/index.ts b/drizzle-orm/src/libsql/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/libsql/index.ts +++ b/drizzle-orm/src/libsql/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/libsql/migrator.ts b/drizzle-orm/src/libsql/migrator.ts index 45631413a..c1eddb519 100644 --- a/drizzle-orm/src/libsql/migrator.ts +++ b/drizzle-orm/src/libsql/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { LibSQLDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { LibSQLDatabase } from './driver.ts'; export function migrate>( db: LibSQLDatabase, diff --git a/drizzle-orm/src/libsql/session.ts b/drizzle-orm/src/libsql/session.ts index 436e80cc9..0271bc881 100644 --- a/drizzle-orm/src/libsql/session.ts +++ b/drizzle-orm/src/libsql/session.ts @@ -1,19 +1,19 @@ import { type Client, type InArgs, type InStatement, type ResultSet, type Transaction } from '@libsql/client'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, type SQL, sql } from '~/sql'; -import { SQLiteTransaction } from '~/sqlite-core'; -import type { SQLiteAsyncDialect } from '~/sqlite-core/dialect'; -import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, type SQL, sql } from '~/sql/index.ts'; +import type { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts'; +import { SQLiteTransaction } from '~/sqlite-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts'; import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteExecuteMethod, type SQLiteTransactionConfig, -} from '~/sqlite-core/session'; -import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session'; -import { mapResultRow } from '~/utils'; +} from '~/sqlite-core/session.ts'; +import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session.ts'; +import { mapResultRow } from '~/utils.ts'; export interface LibSQLSessionOptions { logger?: Logger; diff --git a/drizzle-orm/src/logger.ts b/drizzle-orm/src/logger.ts index c3c3f03db..271fef262 100644 --- a/drizzle-orm/src/logger.ts +++ b/drizzle-orm/src/logger.ts @@ -1,4 +1,4 @@ -import { entityKind } from '~/entity'; +import { entityKind } from '~/entity.ts'; export interface Logger { logQuery(query: string, params: unknown[]): void; diff --git a/drizzle-orm/src/mysql-core/alias.ts b/drizzle-orm/src/mysql-core/alias.ts index 5ad657765..08d70f035 100644 --- a/drizzle-orm/src/mysql-core/alias.ts +++ b/drizzle-orm/src/mysql-core/alias.ts @@ -1,7 +1,7 @@ -import { TableAliasProxyHandler } from '~/alias'; -import type { BuildAliasTable } from './query-builders/select.types'; -import type { MySqlTable } from './table'; -import { type MySqlViewBase } from './view'; +import { TableAliasProxyHandler } from '~/alias.ts'; +import type { BuildAliasTable } from './query-builders/select.types.ts'; +import type { MySqlTable } from './table.ts'; +import { type MySqlViewBase } from './view.ts'; export function alias( table: TTable, diff --git a/drizzle-orm/src/mysql-core/checks.ts b/drizzle-orm/src/mysql-core/checks.ts index a57b185c7..fa76b4537 100644 --- a/drizzle-orm/src/mysql-core/checks.ts +++ b/drizzle-orm/src/mysql-core/checks.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { SQL } from '~/sql'; -import type { MySqlTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { SQL } from '~/sql/index.ts'; +import type { MySqlTable } from './table.ts'; export class CheckBuilder { static readonly [entityKind]: string = 'MySqlCheckBuilder'; diff --git a/drizzle-orm/src/mysql-core/columns/bigint.ts b/drizzle-orm/src/mysql-core/columns/bigint.ts index 9eaf7c8e3..d87195868 100644 --- a/drizzle-orm/src/mysql-core/columns/bigint.ts +++ b/drizzle-orm/src/mysql-core/columns/bigint.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlBigInt53BuilderInitial = MySqlBigInt53Builder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/binary.ts b/drizzle-orm/src/mysql-core/columns/binary.ts index 796d619d2..6deb385d8 100644 --- a/drizzle-orm/src/mysql-core/columns/binary.ts +++ b/drizzle-orm/src/mysql-core/columns/binary.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlBinaryBuilderInitial = MySqlBinaryBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/boolean.ts b/drizzle-orm/src/mysql-core/columns/boolean.ts index fc4d7ea9b..a75131469 100644 --- a/drizzle-orm/src/mysql-core/columns/boolean.ts +++ b/drizzle-orm/src/mysql-core/columns/boolean.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlBooleanBuilderInitial = MySqlBooleanBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/char.ts b/drizzle-orm/src/mysql-core/columns/char.ts index 18b28d4d6..78b845e71 100644 --- a/drizzle-orm/src/mysql-core/columns/char.ts +++ b/drizzle-orm/src/mysql-core/columns/char.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Writable } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlCharBuilderInitial = MySqlCharBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/common.ts b/drizzle-orm/src/mysql-core/columns/common.ts index 6541a5b57..2f1ee2fce 100644 --- a/drizzle-orm/src/mysql-core/columns/common.ts +++ b/drizzle-orm/src/mysql-core/columns/common.ts @@ -1,20 +1,21 @@ -import type { ColumnBaseConfig } from '~/column'; -import { Column } from '~/column'; +import { ColumnBuilder } from '~/column-builder.ts'; import type { + ColumnBuilderBase, ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnBuilderRuntimeConfig, ColumnDataType, HasDefault, MakeColumnConfig, -} from '~/column-builder'; -import { ColumnBuilder } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { ForeignKey, UpdateDeleteAction } from '~/mysql-core/foreign-keys'; -import { ForeignKeyBuilder } from '~/mysql-core/foreign-keys'; -import type { AnyMySqlTable, MySqlTable } from '~/mysql-core/table'; -import { type Update } from '~/utils'; -import { uniqueKeyName } from '../unique-constraint'; +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { Column } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { ForeignKey, UpdateDeleteAction } from '~/mysql-core/foreign-keys.ts'; +import { ForeignKeyBuilder } from '~/mysql-core/foreign-keys.ts'; +import type { AnyMySqlTable, MySqlTable } from '~/mysql-core/table.ts'; +import { type Update } from '~/utils.ts'; +import { uniqueKeyName } from '../unique-constraint.ts'; export interface ReferenceConfig { ref: () => MySqlColumn; @@ -24,6 +25,11 @@ export interface ReferenceConfig { }; } +export interface MySqlColumnBuilderBase< + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, + TTypeConfig extends object = object, +> extends ColumnBuilderBase {} + export abstract class MySqlColumnBuilder< T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig & { data: any; @@ -31,7 +37,9 @@ export abstract class MySqlColumnBuilder< TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig, -> extends ColumnBuilder { +> extends ColumnBuilder + implements MySqlColumnBuilderBase +{ static readonly [entityKind]: string = 'MySqlColumnBuilder'; private foreignKeyConfigs: ReferenceConfig[] = []; diff --git a/drizzle-orm/src/mysql-core/columns/custom.ts b/drizzle-orm/src/mysql-core/columns/custom.ts index c527e3c8f..c67904e38 100644 --- a/drizzle-orm/src/mysql-core/columns/custom.ts +++ b/drizzle-orm/src/mysql-core/columns/custom.ts @@ -1,10 +1,10 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import type { SQL } from '~/sql'; -import { type Equal } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import type { SQL } from '~/sql/index.ts'; +import { type Equal } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type ConvertCustomConfig> = & { diff --git a/drizzle-orm/src/mysql-core/columns/date.common.ts b/drizzle-orm/src/mysql-core/columns/date.common.ts index 6c6282a16..9800a3d90 100644 --- a/drizzle-orm/src/mysql-core/columns/date.common.ts +++ b/drizzle-orm/src/mysql-core/columns/date.common.ts @@ -1,8 +1,13 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnDataType, HasDefault } from '~/column-builder'; -import { entityKind } from '~/entity'; -import { sql } from '~/sql'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { + ColumnBuilderBaseConfig, + ColumnBuilderExtraConfig, + ColumnDataType, + HasDefault, +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import { sql } from '~/sql/index.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export interface MySqlDateColumnBaseConfig { hasOnUpdateNow: boolean; diff --git a/drizzle-orm/src/mysql-core/columns/date.ts b/drizzle-orm/src/mysql-core/columns/date.ts index 3b24bce16..396e23d60 100644 --- a/drizzle-orm/src/mysql-core/columns/date.ts +++ b/drizzle-orm/src/mysql-core/columns/date.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Equal } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Equal } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlDateBuilderInitial = MySqlDateBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/datetime.ts b/drizzle-orm/src/mysql-core/columns/datetime.ts index c3cdb7b88..801801969 100644 --- a/drizzle-orm/src/mysql-core/columns/datetime.ts +++ b/drizzle-orm/src/mysql-core/columns/datetime.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Equal } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Equal } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlDateTimeBuilderInitial = MySqlDateTimeBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/decimal.ts b/drizzle-orm/src/mysql-core/columns/decimal.ts index ba2181b61..db2bd78ac 100644 --- a/drizzle-orm/src/mysql-core/columns/decimal.ts +++ b/drizzle-orm/src/mysql-core/columns/decimal.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlDecimalBuilderInitial = MySqlDecimalBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/double.ts b/drizzle-orm/src/mysql-core/columns/double.ts index 084cec5df..52dc66f72 100644 --- a/drizzle-orm/src/mysql-core/columns/double.ts +++ b/drizzle-orm/src/mysql-core/columns/double.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlDoubleBuilderInitial = MySqlDoubleBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/enum.ts b/drizzle-orm/src/mysql-core/columns/enum.ts index bb30b7ffa..48221f868 100644 --- a/drizzle-orm/src/mysql-core/columns/enum.ts +++ b/drizzle-orm/src/mysql-core/columns/enum.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Writable } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlEnumColumnBuilderInitial = MySqlEnumColumnBuilder<{ diff --git a/drizzle-orm/src/mysql-core/columns/float.ts b/drizzle-orm/src/mysql-core/columns/float.ts index 92e52eabb..71b0291f3 100644 --- a/drizzle-orm/src/mysql-core/columns/float.ts +++ b/drizzle-orm/src/mysql-core/columns/float.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlFloatBuilderInitial = MySqlFloatBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/index.ts b/drizzle-orm/src/mysql-core/columns/index.ts index caeea9248..b51f0fac4 100644 --- a/drizzle-orm/src/mysql-core/columns/index.ts +++ b/drizzle-orm/src/mysql-core/columns/index.ts @@ -1,25 +1,25 @@ -export * from './bigint'; -export * from './binary'; -export * from './boolean'; -export * from './char'; -export * from './common'; -export * from './custom'; -export * from './date'; -export * from './datetime'; -export * from './decimal'; -export * from './double'; -export * from './enum'; -export * from './float'; -export * from './int'; -export * from './json'; -export * from './mediumint'; -export * from './real'; -export * from './serial'; -export * from './smallint'; -export * from './text'; -export * from './time'; -export * from './timestamp'; -export * from './tinyint'; -export * from './varbinary'; -export * from './varchar'; -export * from './year'; +export * from './bigint.ts'; +export * from './binary.ts'; +export * from './boolean.ts'; +export * from './char.ts'; +export * from './common.ts'; +export * from './custom.ts'; +export * from './date.ts'; +export * from './datetime.ts'; +export * from './decimal.ts'; +export * from './double.ts'; +export * from './enum.ts'; +export * from './float.ts'; +export * from './int.ts'; +export * from './json.ts'; +export * from './mediumint.ts'; +export * from './real.ts'; +export * from './serial.ts'; +export * from './smallint.ts'; +export * from './text.ts'; +export * from './time.ts'; +export * from './timestamp.ts'; +export * from './tinyint.ts'; +export * from './varbinary.ts'; +export * from './varchar.ts'; +export * from './year.ts'; diff --git a/drizzle-orm/src/mysql-core/columns/int.ts b/drizzle-orm/src/mysql-core/columns/int.ts index d25af0a9b..a3bdf5377 100644 --- a/drizzle-orm/src/mysql-core/columns/int.ts +++ b/drizzle-orm/src/mysql-core/columns/int.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlIntBuilderInitial = MySqlIntBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/json.ts b/drizzle-orm/src/mysql-core/columns/json.ts index aa7a36ccd..9e52d7bf8 100644 --- a/drizzle-orm/src/mysql-core/columns/json.ts +++ b/drizzle-orm/src/mysql-core/columns/json.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlJsonBuilderInitial = MySqlJsonBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/mediumint.ts b/drizzle-orm/src/mysql-core/columns/mediumint.ts index e682f9c4c..e17e2f368 100644 --- a/drizzle-orm/src/mysql-core/columns/mediumint.ts +++ b/drizzle-orm/src/mysql-core/columns/mediumint.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlMediumIntBuilderInitial = MySqlMediumIntBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/real.ts b/drizzle-orm/src/mysql-core/columns/real.ts index baef1092f..37607d9c5 100644 --- a/drizzle-orm/src/mysql-core/columns/real.ts +++ b/drizzle-orm/src/mysql-core/columns/real.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlRealBuilderInitial = MySqlRealBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/serial.ts b/drizzle-orm/src/mysql-core/columns/serial.ts index cd4b84e3e..5a555c52a 100644 --- a/drizzle-orm/src/mysql-core/columns/serial.ts +++ b/drizzle-orm/src/mysql-core/columns/serial.ts @@ -1,14 +1,14 @@ -import type { ColumnBaseConfig } from '~/column'; import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, HasDefault, MakeColumnConfig, NotNull, -} from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlSerialBuilderInitial = NotNull< HasDefault< diff --git a/drizzle-orm/src/mysql-core/columns/smallint.ts b/drizzle-orm/src/mysql-core/columns/smallint.ts index fb298f211..e1723dbd0 100644 --- a/drizzle-orm/src/mysql-core/columns/smallint.ts +++ b/drizzle-orm/src/mysql-core/columns/smallint.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlSmallIntBuilderInitial = MySqlSmallIntBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/text.ts b/drizzle-orm/src/mysql-core/columns/text.ts index e45730903..9853532d4 100644 --- a/drizzle-orm/src/mysql-core/columns/text.ts +++ b/drizzle-orm/src/mysql-core/columns/text.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Writable } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlTextColumnType = 'tinytext' | 'text' | 'mediumtext' | 'longtext'; diff --git a/drizzle-orm/src/mysql-core/columns/time.ts b/drizzle-orm/src/mysql-core/columns/time.ts index 1bb2b64dc..d3a86dcc4 100644 --- a/drizzle-orm/src/mysql-core/columns/time.ts +++ b/drizzle-orm/src/mysql-core/columns/time.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlTimeBuilderInitial = MySqlTimeBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/timestamp.ts b/drizzle-orm/src/mysql-core/columns/timestamp.ts index 3df4ce134..aed1ad04a 100644 --- a/drizzle-orm/src/mysql-core/columns/timestamp.ts +++ b/drizzle-orm/src/mysql-core/columns/timestamp.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Equal } from '~/utils'; -import { MySqlDateBaseColumn, MySqlDateColumnBaseBuilder } from './date.common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Equal } from '~/utils.ts'; +import { MySqlDateBaseColumn, MySqlDateColumnBaseBuilder } from './date.common.ts'; export type MySqlTimestampBuilderInitial = MySqlTimestampBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/tinyint.ts b/drizzle-orm/src/mysql-core/columns/tinyint.ts index 10eeee2f0..1fdef4e61 100644 --- a/drizzle-orm/src/mysql-core/columns/tinyint.ts +++ b/drizzle-orm/src/mysql-core/columns/tinyint.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumnBuilderWithAutoIncrement, MySqlColumnWithAutoIncrement } from './common.ts'; export type MySqlTinyIntBuilderInitial = MySqlTinyIntBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/varbinary.ts b/drizzle-orm/src/mysql-core/columns/varbinary.ts index d7346cb24..a4a856509 100644 --- a/drizzle-orm/src/mysql-core/columns/varbinary.ts +++ b/drizzle-orm/src/mysql-core/columns/varbinary.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlVarBinaryBuilderInitial = MySqlVarBinaryBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/columns/varchar.ts b/drizzle-orm/src/mysql-core/columns/varchar.ts index 3db23be5c..99c52db77 100644 --- a/drizzle-orm/src/mysql-core/columns/varchar.ts +++ b/drizzle-orm/src/mysql-core/columns/varchar.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { type Writable } from '~/utils'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlVarCharBuilderInitial = MySqlVarCharBuilder< { diff --git a/drizzle-orm/src/mysql-core/columns/year.ts b/drizzle-orm/src/mysql-core/columns/year.ts index fecee20cf..0e1a64d36 100644 --- a/drizzle-orm/src/mysql-core/columns/year.ts +++ b/drizzle-orm/src/mysql-core/columns/year.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyMySqlTable } from '~/mysql-core/table'; -import { MySqlColumn, MySqlColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlTable } from '~/mysql-core/table.ts'; +import { MySqlColumn, MySqlColumnBuilder } from './common.ts'; export type MySqlYearBuilderInitial = MySqlYearBuilder<{ name: TName; diff --git a/drizzle-orm/src/mysql-core/db.ts b/drizzle-orm/src/mysql-core/db.ts index 607b1a0c8..3c79f9d86 100644 --- a/drizzle-orm/src/mysql-core/db.ts +++ b/drizzle-orm/src/mysql-core/db.ts @@ -1,21 +1,25 @@ import type { ResultSetHeader } from 'mysql2/promise'; -import { entityKind } from '~/entity'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import { type ExtractTablesWithRelations, type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import type { SQLWrapper } from '~/sql'; -import { SelectionProxyHandler, WithSubquery } from '~/subquery'; -import { type DrizzleTypeError } from '~/utils'; -import { type ColumnsSelection } from '~/view'; -import type { MySqlDialect } from './dialect'; +import { entityKind } from '~/entity.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import { + type ExtractTablesWithRelations, + type RelationalSchemaConfig, + type TablesRelationalConfig, +} from '~/relations.ts'; +import type { SQLWrapper } from '~/sql/index.ts'; +import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; +import { type DrizzleTypeError } from '~/utils.ts'; +import { type ColumnsSelection } from '~/view.ts'; +import type { MySqlDialect } from './dialect.ts'; import { MySqlDelete, MySqlInsertBuilder, MySqlSelectBuilder, MySqlUpdateBuilder, QueryBuilder, -} from './query-builders'; -import { RelationalQueryBuilder } from './query-builders/query'; -import type { SelectedFields } from './query-builders/select.types'; +} from './query-builders/index.ts'; +import { RelationalQueryBuilder } from './query-builders/query.ts'; +import type { SelectedFields } from './query-builders/select.types.ts'; import type { Mode, MySqlSession, @@ -24,9 +28,9 @@ import type { PreparedQueryHKTBase, QueryResultHKT, QueryResultKind, -} from './session'; -import type { WithSubqueryWithSelection } from './subquery'; -import type { MySqlTable } from './table'; +} from './session.ts'; +import type { WithSubqueryWithSelection } from './subquery.ts'; +import type { MySqlTable } from './table.ts'; export class MySqlDatabase< TQueryResult extends QueryResultHKT, diff --git a/drizzle-orm/src/mysql-core/dialect.ts b/drizzle-orm/src/mysql-core/dialect.ts index dcb6cfaa6..46dbd2d5e 100644 --- a/drizzle-orm/src/mysql-core/dialect.ts +++ b/drizzle-orm/src/mysql-core/dialect.ts @@ -1,7 +1,7 @@ -import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from '~/alias'; -import { Column } from '~/column'; -import { entityKind, is } from '~/entity'; -import type { MigrationConfig, MigrationMeta } from '~/migrator'; +import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from '~/alias.ts'; +import { Column } from '~/column.ts'; +import { entityKind, is } from '~/entity.ts'; +import type { MigrationConfig, MigrationMeta } from '~/migrator.ts'; import { type BuildRelationalQueryResult, type DBQueryConfig, @@ -13,21 +13,21 @@ import { type Relation, type TableRelationalConfig, type TablesRelationalConfig, -} from '~/relations'; -import { and, eq, Param, type Query, SQL, sql, type SQLChunk } from '~/sql'; -import { Subquery, SubqueryConfig } from '~/subquery'; -import { getTableName, Table } from '~/table'; -import { orderSelectedFields, type UpdateSet } from '~/utils'; -import { View, ViewBaseConfig } from '~/view'; -import { DrizzleError } from '..'; -import { MySqlColumn } from './columns/common'; -import type { MySqlDeleteConfig } from './query-builders/delete'; -import type { MySqlInsertConfig } from './query-builders/insert'; -import type { Join, MySqlSelectConfig, SelectedFieldsOrdered } from './query-builders/select.types'; -import type { MySqlUpdateConfig } from './query-builders/update'; -import type { MySqlSession } from './session'; -import { MySqlTable } from './table'; -import { MySqlViewBase } from './view'; +} from '~/relations.ts'; +import { and, eq, Param, type Query, SQL, sql, type SQLChunk } from '~/sql/index.ts'; +import { Subquery, SubqueryConfig } from '~/subquery.ts'; +import { getTableName, Table } from '~/table.ts'; +import { orderSelectedFields, type UpdateSet } from '~/utils.ts'; +import { View, ViewBaseConfig } from '~/view.ts'; +import { DrizzleError } from '../index.ts'; +import { MySqlColumn } from './columns/common.ts'; +import type { MySqlDeleteConfig } from './query-builders/delete.ts'; +import type { MySqlInsertConfig } from './query-builders/insert.ts'; +import type { Join, MySqlSelectConfig, SelectedFieldsOrdered } from './query-builders/select.types.ts'; +import type { MySqlUpdateConfig } from './query-builders/update.ts'; +import type { MySqlSession } from './session.ts'; +import { MySqlTable } from './table.ts'; +import { MySqlViewBase } from './view.ts'; // TODO find out how to use all/values. Seems like I need those functions // Build project @@ -338,8 +338,8 @@ export class MySqlDialect { // const isSingleValue = values.length === 1; const valuesSqlList: ((SQLChunk | SQL)[] | SQL)[] = []; const columns: Record = table[Table.Symbol.Columns]; - const colEntries: [string, MySqlColumn][] = Object.entries(columns) - + const colEntries: [string, MySqlColumn][] = Object.entries(columns); + const insertOrder = colEntries.map(([, column]) => sql.identifier(column.name)); for (const [valueIndex, value] of values.entries()) { diff --git a/drizzle-orm/src/mysql-core/expressions.ts b/drizzle-orm/src/mysql-core/expressions.ts index 6625f72d1..76db28551 100644 --- a/drizzle-orm/src/mysql-core/expressions.ts +++ b/drizzle-orm/src/mysql-core/expressions.ts @@ -1,9 +1,9 @@ -import { bindIfParam } from '~/expressions'; -import type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql'; -import { sql } from '~/sql'; -import type { MySqlColumn } from './columns'; +import { bindIfParam } from '~/expressions.ts'; +import type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql/index.ts'; +import { sql } from '~/sql/index.ts'; +import type { MySqlColumn } from './columns/index.ts'; -export * from '~/expressions'; +export * from '~/expressions.ts'; export function concat(column: MySqlColumn | SQL.Aliased, value: string | Placeholder | SQLWrapper): SQL { return sql`${column} || ${bindIfParam(value, column)}`; diff --git a/drizzle-orm/src/mysql-core/foreign-keys.ts b/drizzle-orm/src/mysql-core/foreign-keys.ts index 9d4123542..8f9abdae8 100644 --- a/drizzle-orm/src/mysql-core/foreign-keys.ts +++ b/drizzle-orm/src/mysql-core/foreign-keys.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { AnyMySqlColumn, MySqlColumn } from './columns'; -import { MySqlTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlColumn, MySqlColumn } from './columns/index.ts'; +import { MySqlTable } from './table.ts'; export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default'; diff --git a/drizzle-orm/src/mysql-core/index.ts b/drizzle-orm/src/mysql-core/index.ts index 0582ea974..7120e0c5c 100644 --- a/drizzle-orm/src/mysql-core/index.ts +++ b/drizzle-orm/src/mysql-core/index.ts @@ -1,16 +1,16 @@ -export * from './alias'; -export * from './checks'; -export * from './columns'; -export * from './db'; -export * from './dialect'; -export * from './foreign-keys'; -export * from './indexes'; -export * from './primary-keys'; -export * from './unique-constraint'; -export * from './query-builders'; -export * from './schema'; -export * from './session'; -export * from './subquery'; -export * from './table'; -export * from './utils'; -export * from './view'; +export * from './alias.ts'; +export * from './checks.ts'; +export * from './columns/index.ts'; +export * from './db.ts'; +export * from './dialect.ts'; +export * from './foreign-keys.ts'; +export * from './indexes.ts'; +export * from './primary-keys.ts'; +export * from './query-builders/index.ts'; +export * from './schema.ts'; +export * from './session.ts'; +export * from './subquery.ts'; +export * from './table.ts'; +export * from './unique-constraint.ts'; +export * from './utils.ts'; +export * from './view.ts'; diff --git a/drizzle-orm/src/mysql-core/indexes.ts b/drizzle-orm/src/mysql-core/indexes.ts index c9bb5c553..8a6139e1e 100644 --- a/drizzle-orm/src/mysql-core/indexes.ts +++ b/drizzle-orm/src/mysql-core/indexes.ts @@ -1,7 +1,7 @@ -import { entityKind } from '~/entity'; -import type { SQL } from '~/sql'; -import type { AnyMySqlColumn, MySqlColumn } from './columns'; -import type { MySqlTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { SQL } from '~/sql/index.ts'; +import type { AnyMySqlColumn, MySqlColumn } from './columns/index.ts'; +import type { MySqlTable } from './table.ts'; interface IndexConfig { name: string; diff --git a/drizzle-orm/src/mysql-core/primary-keys.ts b/drizzle-orm/src/mysql-core/primary-keys.ts index 34837cb8d..26bd3edca 100644 --- a/drizzle-orm/src/mysql-core/primary-keys.ts +++ b/drizzle-orm/src/mysql-core/primary-keys.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { AnyMySqlColumn, MySqlColumn } from './columns'; -import { MySqlTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { AnyMySqlColumn, MySqlColumn } from './columns/index.ts'; +import { MySqlTable } from './table.ts'; export function primaryKey< TTableName extends string, diff --git a/drizzle-orm/src/mysql-core/query-builders/delete.ts b/drizzle-orm/src/mysql-core/query-builders/delete.ts index 05c86de72..7ec773f82 100644 --- a/drizzle-orm/src/mysql-core/query-builders/delete.ts +++ b/drizzle-orm/src/mysql-core/query-builders/delete.ts @@ -1,5 +1,5 @@ -import { entityKind } from '~/entity'; -import type { MySqlDialect } from '~/mysql-core/dialect'; +import { entityKind } from '~/entity.ts'; +import type { MySqlDialect } from '~/mysql-core/dialect.ts'; import type { MySqlSession, PreparedQueryConfig, @@ -7,11 +7,11 @@ import type { PreparedQueryKind, QueryResultHKT, QueryResultKind, -} from '~/mysql-core/session'; -import type { MySqlTable } from '~/mysql-core/table'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL, SQLWrapper } from '~/sql'; -import type { SelectedFieldsOrdered } from './select.types'; +} from '~/mysql-core/session.ts'; +import type { MySqlTable } from '~/mysql-core/table.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL, SQLWrapper } from '~/sql/index.ts'; +import type { SelectedFieldsOrdered } from './select.types.ts'; export interface MySqlDeleteConfig { where?: SQL | undefined; diff --git a/drizzle-orm/src/mysql-core/query-builders/index.ts b/drizzle-orm/src/mysql-core/query-builders/index.ts index 8da6da017..16f0e1d4d 100644 --- a/drizzle-orm/src/mysql-core/query-builders/index.ts +++ b/drizzle-orm/src/mysql-core/query-builders/index.ts @@ -1,6 +1,6 @@ -export * from './delete'; -export * from './insert'; -export * from './query-builder'; -export * from './select'; -export * from './select.types'; -export * from './update'; +export * from './delete.ts'; +export * from './insert.ts'; +export * from './query-builder.ts'; +export * from './select.ts'; +export * from './select.types.ts'; +export * from './update.ts'; diff --git a/drizzle-orm/src/mysql-core/query-builders/insert.ts b/drizzle-orm/src/mysql-core/query-builders/insert.ts index 0886d820b..5dacdbf64 100644 --- a/drizzle-orm/src/mysql-core/query-builders/insert.ts +++ b/drizzle-orm/src/mysql-core/query-builders/insert.ts @@ -1,5 +1,5 @@ -import { entityKind, is } from '~/entity'; -import type { MySqlDialect } from '~/mysql-core/dialect'; +import { entityKind, is } from '~/entity.ts'; +import type { MySqlDialect } from '~/mysql-core/dialect.ts'; import type { MySqlSession, PreparedQueryConfig, @@ -7,14 +7,14 @@ import type { PreparedQueryKind, QueryResultHKT, QueryResultKind, -} from '~/mysql-core/session'; -import type { MySqlTable } from '~/mysql-core/table'; -import { QueryPromise } from '~/query-promise'; -import type { Placeholder, Query, SQLWrapper } from '~/sql'; -import { Param, SQL, sql } from '~/sql'; -import { type InferModel, Table } from '~/table'; -import { mapUpdateSet } from '~/utils'; -import type { MySqlUpdateSetSource } from './update'; +} from '~/mysql-core/session.ts'; +import type { MySqlTable } from '~/mysql-core/table.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Placeholder, Query, SQLWrapper } from '~/sql/index.ts'; +import { Param, SQL, sql } from '~/sql/index.ts'; +import { type InferModel, Table } from '~/table.ts'; +import { mapUpdateSet } from '~/utils.ts'; +import type { MySqlUpdateSetSource } from './update.ts'; export interface MySqlInsertConfig { table: TTable; diff --git a/drizzle-orm/src/mysql-core/query-builders/query-builder.ts b/drizzle-orm/src/mysql-core/query-builders/query-builder.ts index e39c9abeb..b91ce61f5 100644 --- a/drizzle-orm/src/mysql-core/query-builders/query-builder.ts +++ b/drizzle-orm/src/mysql-core/query-builders/query-builder.ts @@ -1,11 +1,11 @@ -import { entityKind } from '~/entity'; -import { MySqlDialect } from '~/mysql-core/dialect'; -import type { WithSubqueryWithSelection } from '~/mysql-core/subquery'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import { SelectionProxyHandler, WithSubquery } from '~/subquery'; -import { type ColumnsSelection } from '~/view'; -import { MySqlSelectBuilder } from './select'; -import type { SelectedFields } from './select.types'; +import { entityKind } from '~/entity.ts'; +import { MySqlDialect } from '~/mysql-core/dialect.ts'; +import type { WithSubqueryWithSelection } from '~/mysql-core/subquery.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; +import { type ColumnsSelection } from '~/view.ts'; +import { MySqlSelectBuilder } from './select.ts'; +import type { SelectedFields } from './select.types.ts'; export class QueryBuilder { static readonly [entityKind]: string = 'MySqlQueryBuilder'; diff --git a/drizzle-orm/src/mysql-core/query-builders/query.ts b/drizzle-orm/src/mysql-core/query-builders/query.ts index c7be3356a..45a040189 100644 --- a/drizzle-orm/src/mysql-core/query-builders/query.ts +++ b/drizzle-orm/src/mysql-core/query-builders/query.ts @@ -1,23 +1,23 @@ -import { entityKind } from '~/entity'; -import { QueryPromise } from '~/query-promise'; +import { entityKind } from '~/entity.ts'; +import { QueryPromise } from '~/query-promise.ts'; import { type BuildQueryResult, type DBQueryConfig, mapRelationalRow, type TableRelationalConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type SQL } from '~/sql'; -import { type KnownKeysOnly } from '~/utils'; -import { type MySqlDialect } from '../dialect'; +} from '~/relations.ts'; +import { type SQL } from '~/sql/index.ts'; +import { type KnownKeysOnly } from '~/utils.ts'; +import { type MySqlDialect } from '../dialect.ts'; import { type Mode, type MySqlSession, type PreparedQueryConfig, type PreparedQueryHKTBase, type PreparedQueryKind, -} from '../session'; -import { type MySqlTable } from '../table'; +} from '../session.ts'; +import { type MySqlTable } from '../table.ts'; export class RelationalQueryBuilder< TPreparedQueryHKT extends PreparedQueryHKTBase, diff --git a/drizzle-orm/src/mysql-core/query-builders/select.ts b/drizzle-orm/src/mysql-core/query-builders/select.ts index 88bb24553..08ab3854c 100644 --- a/drizzle-orm/src/mysql-core/query-builders/select.ts +++ b/drizzle-orm/src/mysql-core/query-builders/select.ts @@ -1,11 +1,16 @@ -import { entityKind, is } from '~/entity'; -import type { MySqlColumn } from '~/mysql-core/columns'; -import type { MySqlDialect } from '~/mysql-core/dialect'; -import type { MySqlSession, PreparedQueryConfig, PreparedQueryHKTBase, PreparedQueryKind } from '~/mysql-core/session'; -import type { SubqueryWithSelection } from '~/mysql-core/subquery'; -import type { MySqlTable } from '~/mysql-core/table'; -import { MySqlViewBase } from '~/mysql-core/view'; -import { TypedQueryBuilder } from '~/query-builders/query-builder'; +import { entityKind, is } from '~/entity.ts'; +import type { MySqlColumn } from '~/mysql-core/columns/index.ts'; +import type { MySqlDialect } from '~/mysql-core/dialect.ts'; +import type { + MySqlSession, + PreparedQueryConfig, + PreparedQueryHKTBase, + PreparedQueryKind, +} from '~/mysql-core/session.ts'; +import type { SubqueryWithSelection } from '~/mysql-core/subquery.ts'; +import type { MySqlTable } from '~/mysql-core/table.ts'; +import { MySqlViewBase } from '~/mysql-core/view.ts'; +import { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; import type { BuildSubquerySelection, GetSelectTableName, @@ -14,14 +19,14 @@ import type { JoinType, SelectMode, SelectResult, -} from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import { type Query, SQL } from '~/sql'; -import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery'; -import { Table } from '~/table'; -import { applyMixins, getTableColumns, getTableLikeName, type ValueOrArray } from '~/utils'; -import { orderSelectedFields } from '~/utils'; -import { type ColumnsSelection, View, ViewBaseConfig } from '~/view'; +} from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import { type Query, SQL } from '~/sql/index.ts'; +import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery.ts'; +import { Table } from '~/table.ts'; +import { applyMixins, getTableColumns, getTableLikeName, type ValueOrArray } from '~/utils.ts'; +import { orderSelectedFields } from '~/utils.ts'; +import { type ColumnsSelection, View, ViewBaseConfig } from '~/view.ts'; import type { JoinFn, LockConfig, @@ -31,7 +36,7 @@ import type { MySqlSelectHKTBase, MySqlSelectQueryBuilderHKT, SelectedFields, -} from './select.types'; +} from './select.types.ts'; type CreateMySqlSelectFromBuilderMode< TBuilderMode extends 'db' | 'qb', diff --git a/drizzle-orm/src/mysql-core/query-builders/select.types.ts b/drizzle-orm/src/mysql-core/query-builders/select.types.ts index 7d4c7f1c6..b75023cdf 100644 --- a/drizzle-orm/src/mysql-core/query-builders/select.types.ts +++ b/drizzle-orm/src/mysql-core/query-builders/select.types.ts @@ -1,11 +1,11 @@ -import type { MySqlColumn } from '~/mysql-core/columns'; -import type { MySqlTable, MySqlTableWithColumns } from '~/mysql-core/table'; -import type { MySqlViewBase, MySqlViewWithSelection } from '~/mysql-core/view'; +import type { MySqlColumn } from '~/mysql-core/columns/index.ts'; +import type { MySqlTable, MySqlTableWithColumns } from '~/mysql-core/table.ts'; +import type { MySqlViewBase, MySqlViewWithSelection } from '~/mysql-core/view.ts'; import type { SelectedFields as SelectedFieldsBase, SelectedFieldsFlat as SelectedFieldsFlatBase, SelectedFieldsOrdered as SelectedFieldsOrderedBase, -} from '~/operations'; +} from '~/operations.ts'; import type { AppendToNullabilityMap, AppendToResult, @@ -14,14 +14,14 @@ import type { JoinType, MapColumnsToTableAlias, SelectMode, -} from '~/query-builders/select.types'; -import type { Placeholder, SQL } from '~/sql'; -import type { Subquery } from '~/subquery'; -import type { Table, UpdateTableConfig } from '~/table'; -import type { Assume } from '~/utils'; -import { type ColumnsSelection, type View } from '~/view'; -import { type PreparedQueryHKTBase } from '../session'; -import type { MySqlSelect, MySqlSelectQueryBuilder } from './select'; +} from '~/query-builders/select.types.ts'; +import type { Placeholder, SQL } from '~/sql/index.ts'; +import type { Subquery } from '~/subquery.ts'; +import type { Table, UpdateTableConfig } from '~/table.ts'; +import type { Assume } from '~/utils.ts'; +import { type ColumnsSelection, type View } from '~/view.ts'; +import { type PreparedQueryHKTBase } from '../session.ts'; +import type { MySqlSelect, MySqlSelectQueryBuilder } from './select.ts'; export interface Join { on: SQL | undefined; diff --git a/drizzle-orm/src/mysql-core/query-builders/update.ts b/drizzle-orm/src/mysql-core/query-builders/update.ts index b3d51037a..2412660c8 100644 --- a/drizzle-orm/src/mysql-core/query-builders/update.ts +++ b/drizzle-orm/src/mysql-core/query-builders/update.ts @@ -1,6 +1,6 @@ -import type { GetColumnData } from '~/column'; -import { entityKind } from '~/entity'; -import type { MySqlDialect } from '~/mysql-core/dialect'; +import type { GetColumnData } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { MySqlDialect } from '~/mysql-core/dialect.ts'; import type { MySqlSession, PreparedQueryConfig, @@ -8,12 +8,12 @@ import type { PreparedQueryKind, QueryResultHKT, QueryResultKind, -} from '~/mysql-core/session'; -import type { MySqlTable } from '~/mysql-core/table'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL, SQLWrapper } from '~/sql'; -import { mapUpdateSet, type UpdateSet } from '~/utils'; -import type { SelectedFieldsOrdered } from './select.types'; +} from '~/mysql-core/session.ts'; +import type { MySqlTable } from '~/mysql-core/table.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL, SQLWrapper } from '~/sql/index.ts'; +import { mapUpdateSet, type UpdateSet } from '~/utils.ts'; +import type { SelectedFieldsOrdered } from './select.types.ts'; export interface MySqlUpdateConfig { where?: SQL | undefined; diff --git a/drizzle-orm/src/mysql-core/schema.ts b/drizzle-orm/src/mysql-core/schema.ts index 2e7f4cbbc..b36531e44 100644 --- a/drizzle-orm/src/mysql-core/schema.ts +++ b/drizzle-orm/src/mysql-core/schema.ts @@ -1,6 +1,6 @@ -import { entityKind, is } from '~/entity'; -import { type MySqlTableFn, mysqlTableWithSchema } from './table'; -import { type mysqlView, mysqlViewWithSchema } from './view'; +import { entityKind, is } from '~/entity.ts'; +import { type MySqlTableFn, mysqlTableWithSchema } from './table.ts'; +import { type mysqlView, mysqlViewWithSchema } from './view.ts'; export class MySqlSchema { static readonly [entityKind]: string = 'MySqlSchema'; diff --git a/drizzle-orm/src/mysql-core/session.ts b/drizzle-orm/src/mysql-core/session.ts index bba1a94c3..224b7068c 100644 --- a/drizzle-orm/src/mysql-core/session.ts +++ b/drizzle-orm/src/mysql-core/session.ts @@ -1,11 +1,11 @@ -import { entityKind } from '~/entity'; -import { TransactionRollbackError } from '~/errors'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { type Query, type SQL, sql } from '~/sql'; -import { type Assume, type Equal } from '~/utils'; -import { MySqlDatabase } from './db'; -import type { MySqlDialect } from './dialect'; -import type { SelectedFieldsOrdered } from './query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import { TransactionRollbackError } from '~/errors.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { type Query, type SQL, sql } from '~/sql/index.ts'; +import { type Assume, type Equal } from '~/utils.ts'; +import { MySqlDatabase } from './db.ts'; +import type { MySqlDialect } from './dialect.ts'; +import type { SelectedFieldsOrdered } from './query-builders/select.types.ts'; export type Mode = 'default' | 'planetscale'; diff --git a/drizzle-orm/src/mysql-core/subquery.ts b/drizzle-orm/src/mysql-core/subquery.ts index b8d5b9803..603a86b5a 100644 --- a/drizzle-orm/src/mysql-core/subquery.ts +++ b/drizzle-orm/src/mysql-core/subquery.ts @@ -1,7 +1,7 @@ -import { type Dialect } from '~/column-builder'; -import type { AddAliasToSelection } from '~/query-builders/select.types'; -import type { Subquery, WithSubquery } from '~/subquery'; -import { type ColumnsSelection } from '~/view'; +import { type Dialect } from '~/column-builder.ts'; +import type { AddAliasToSelection } from '~/query-builders/select.types.ts'; +import type { Subquery, WithSubquery } from '~/subquery.ts'; +import { type ColumnsSelection } from '~/view.ts'; export type SubqueryWithSelection< TSelection extends ColumnsSelection, diff --git a/drizzle-orm/src/mysql-core/table.ts b/drizzle-orm/src/mysql-core/table.ts index c9e06b6eb..3d42df17c 100644 --- a/drizzle-orm/src/mysql-core/table.ts +++ b/drizzle-orm/src/mysql-core/table.ts @@ -1,12 +1,12 @@ -import type { BuildColumns } from '~/column-builder'; -import { entityKind } from '~/entity'; -import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table'; -import type { CheckBuilder } from './checks'; -import type { MySqlColumn, MySqlColumnBuilder } from './columns/common'; -import type { ForeignKey, ForeignKeyBuilder } from './foreign-keys'; -import type { AnyIndexBuilder } from './indexes'; -import type { PrimaryKeyBuilder } from './primary-keys'; -import type { UniqueConstraintBuilder } from './unique-constraint'; +import type { BuildColumns } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table.ts'; +import type { CheckBuilder } from './checks.ts'; +import type { MySqlColumn, MySqlColumnBuilder, MySqlColumnBuilderBase } from './columns/common.ts'; +import type { ForeignKey, ForeignKeyBuilder } from './foreign-keys.ts'; +import type { AnyIndexBuilder } from './indexes.ts'; +import type { PrimaryKeyBuilder } from './primary-keys.ts'; +import type { UniqueConstraintBuilder } from './unique-constraint.ts'; export type MySqlTableExtraConfig = Record< string, @@ -57,7 +57,7 @@ export type MySqlTableWithColumns = export function mysqlTableWithSchema< TTableName extends string, TSchemaName extends string | undefined, - TColumnsMap extends Record, + TColumnsMap extends Record, >( name: TTableName, columns: TColumnsMap, @@ -78,7 +78,8 @@ export function mysqlTableWithSchema< }>(name, schema, baseName); const builtColumns = Object.fromEntries( - Object.entries(columns).map(([name, colBuilder]) => { + Object.entries(columns).map(([name, colBuilderBase]) => { + const colBuilder = colBuilderBase as MySqlColumnBuilder; const column = colBuilder.build(rawTable); rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable)); return [name, column]; @@ -101,7 +102,7 @@ export function mysqlTableWithSchema< export interface MySqlTableFn { < TTableName extends string, - TColumnsMap extends Record, + TColumnsMap extends Record, >( name: TTableName, columns: TColumnsMap, diff --git a/drizzle-orm/src/mysql-core/unique-constraint.ts b/drizzle-orm/src/mysql-core/unique-constraint.ts index 348c3ad12..66ed65198 100644 --- a/drizzle-orm/src/mysql-core/unique-constraint.ts +++ b/drizzle-orm/src/mysql-core/unique-constraint.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { MySqlColumn } from './columns'; -import { MySqlTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { MySqlColumn } from './columns/index.ts'; +import { MySqlTable } from './table.ts'; export function unique(name?: string): UniqueOnConstraintBuilder { return new UniqueOnConstraintBuilder(name); diff --git a/drizzle-orm/src/mysql-core/utils.ts b/drizzle-orm/src/mysql-core/utils.ts index d8cccf817..1d53694f7 100644 --- a/drizzle-orm/src/mysql-core/utils.ts +++ b/drizzle-orm/src/mysql-core/utils.ts @@ -1,18 +1,18 @@ -import { is } from '~/entity'; -import { Table } from '~/table'; -import { ViewBaseConfig } from '~/view'; -import type { Check } from './checks'; -import { CheckBuilder } from './checks'; -import type { ForeignKey } from './foreign-keys'; -import { ForeignKeyBuilder } from './foreign-keys'; -import type { Index } from './indexes'; -import { IndexBuilder } from './indexes'; -import type { PrimaryKey } from './primary-keys'; -import { PrimaryKeyBuilder } from './primary-keys'; -import { MySqlTable } from './table'; -import { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint'; -import type { MySqlView } from './view'; -import { MySqlViewConfig } from './view'; +import { is } from '~/entity.ts'; +import { Table } from '~/table.ts'; +import { ViewBaseConfig } from '~/view.ts'; +import type { Check } from './checks.ts'; +import { CheckBuilder } from './checks.ts'; +import type { ForeignKey } from './foreign-keys.ts'; +import { ForeignKeyBuilder } from './foreign-keys.ts'; +import type { Index } from './indexes.ts'; +import { IndexBuilder } from './indexes.ts'; +import type { PrimaryKey } from './primary-keys.ts'; +import { PrimaryKeyBuilder } from './primary-keys.ts'; +import { MySqlTable } from './table.ts'; +import { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint.ts'; +import type { MySqlView } from './view.ts'; +import { MySqlViewConfig } from './view.ts'; export function getTableConfig(table: MySqlTable) { const columns = Object.values(table[MySqlTable.Symbol.Columns]); diff --git a/drizzle-orm/src/mysql-core/view.ts b/drizzle-orm/src/mysql-core/view.ts index 1a3da6f4a..5c81dff21 100644 --- a/drizzle-orm/src/mysql-core/view.ts +++ b/drizzle-orm/src/mysql-core/view.ts @@ -1,15 +1,15 @@ -import type { BuildColumns } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import type { AddAliasToSelection } from '~/query-builders/select.types'; -import type { SQL } from '~/sql'; -import { SelectionProxyHandler } from '~/subquery'; -import { getTableColumns } from '~/utils'; -import { type ColumnsSelection, View } from '~/view'; -import { type MySqlColumn, type MySqlColumnBuilder } from './columns'; -import { QueryBuilder } from './query-builders'; -import type { SelectedFields } from './query-builders/select.types'; -import { mysqlTable } from './table'; +import type { BuildColumns } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import type { AddAliasToSelection } from '~/query-builders/select.types.ts'; +import type { SQL } from '~/sql/index.ts'; +import { SelectionProxyHandler } from '~/subquery.ts'; +import { getTableColumns } from '~/utils.ts'; +import { type ColumnsSelection, View } from '~/view.ts'; +import { type MySqlColumn, type MySqlColumnBuilderBase } from './columns/index.ts'; +import { QueryBuilder } from './query-builders/index.ts'; +import type { SelectedFields } from './query-builders/select.types.ts'; +import { mysqlTable } from './table.ts'; export interface ViewBuilderConfig { algorithm?: 'undefined' | 'merge' | 'temptable'; @@ -95,7 +95,7 @@ export class ViewBuilder extends ViewBuilderCore< export class ManualViewBuilder< TName extends string = string, - TColumns extends Record = Record, + TColumns extends Record = Record, > extends ViewBuilderCore<{ name: TName; columns: TColumns }> { static readonly [entityKind]: string = 'MySqlManualViewBuilder'; @@ -199,7 +199,7 @@ export type MySqlViewWithSelection< /** @internal */ export function mysqlViewWithSchema( name: string, - selection: Record | undefined, + selection: Record | undefined, schema: string | undefined, ): ViewBuilder | ManualViewBuilder { if (selection) { @@ -209,13 +209,13 @@ export function mysqlViewWithSchema( } export function mysqlView(name: TName): ViewBuilder; -export function mysqlView>( +export function mysqlView>( name: TName, columns: TColumns, ): ManualViewBuilder; export function mysqlView( name: string, - selection?: Record, + selection?: Record, ): ViewBuilder | ManualViewBuilder { return mysqlViewWithSchema(name, selection, undefined); } diff --git a/drizzle-orm/src/mysql2/driver.ts b/drizzle-orm/src/mysql2/driver.ts index c16afc555..87c21df26 100644 --- a/drizzle-orm/src/mysql2/driver.ts +++ b/drizzle-orm/src/mysql2/driver.ts @@ -1,20 +1,20 @@ import { type Connection as CallbackConnection, type Pool as CallbackPool } from 'mysql2'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { MySqlDialect } from '~/mysql-core/dialect'; -import type { Mode } from '~/mysql-core/session'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { MySqlDatabase } from '~/mysql-core/db.ts'; +import { MySqlDialect } from '~/mysql-core/dialect.ts'; +import type { Mode } from '~/mysql-core/session.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import { DrizzleError } from '..'; -import { MySqlDatabase } from '.'; -import type { MySql2Client, MySql2PreparedQueryHKT, MySql2QueryResultHKT } from './session'; -import { MySql2Session } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { DrizzleError } from '../index.ts'; +import type { MySql2Client, MySql2PreparedQueryHKT, MySql2QueryResultHKT } from './session.ts'; +import { MySql2Session } from './session.ts'; export interface MySqlDriverOptions { logger?: Logger; @@ -38,7 +38,7 @@ export class MySql2Driver { } } -export { MySqlDatabase } from '~/mysql-core/db'; +export { MySqlDatabase } from '~/mysql-core/db.ts'; export type MySql2Database< TSchema extends Record = Record, diff --git a/drizzle-orm/src/mysql2/index.ts b/drizzle-orm/src/mysql2/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/mysql2/index.ts +++ b/drizzle-orm/src/mysql2/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/mysql2/migrator.ts b/drizzle-orm/src/mysql2/migrator.ts index 1b76545e5..2f3c9c3dc 100644 --- a/drizzle-orm/src/mysql2/migrator.ts +++ b/drizzle-orm/src/mysql2/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { MySql2Database } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { MySql2Database } from './driver.ts'; export async function migrate>( db: MySql2Database, diff --git a/drizzle-orm/src/mysql2/session.ts b/drizzle-orm/src/mysql2/session.ts index 4a13dd8e8..31b86a56d 100644 --- a/drizzle-orm/src/mysql2/session.ts +++ b/drizzle-orm/src/mysql2/session.ts @@ -10,11 +10,11 @@ import { type RowDataPacket, } from 'mysql2/promise'; import { once } from 'node:events'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import type { MySqlDialect } from '~/mysql-core/dialect'; -import type { SelectedFieldsOrdered } from '~/mysql-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import type { MySqlDialect } from '~/mysql-core/dialect.ts'; +import type { SelectedFieldsOrdered } from '~/mysql-core/query-builders/select.types.ts'; import { type Mode, MySqlSession, @@ -25,10 +25,10 @@ import { type PreparedQueryHKT, type PreparedQueryKind, type QueryResultHKT, -} from '~/mysql-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, type SQL, sql } from '~/sql'; -import { type Assume, mapResultRow } from '~/utils'; +} from '~/mysql-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, type SQL, sql } from '~/sql/index.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; export type MySql2Client = Pool | Connection; diff --git a/drizzle-orm/src/neon-http/driver.ts b/drizzle-orm/src/neon-http/driver.ts index f09143493..9681299ce 100644 --- a/drizzle-orm/src/neon-http/driver.ts +++ b/drizzle-orm/src/neon-http/driver.ts @@ -1,17 +1,17 @@ import { types } from '@neondatabase/serverless'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { PgDatabase } from '~/pg-core/db'; -import { PgDialect } from '~/pg-core/dialect'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { PgDatabase } from '~/pg-core/db.ts'; +import { PgDialect } from '~/pg-core/dialect.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import { type NeonHttpClient, type NeonHttpQueryResultHKT, NeonHttpSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { type NeonHttpClient, type NeonHttpQueryResultHKT, NeonHttpSession } from './session.ts'; export interface NeonDriverOptions { logger?: Logger; @@ -72,6 +72,6 @@ export function drizzle = Record; } diff --git a/drizzle-orm/src/neon-http/index.ts b/drizzle-orm/src/neon-http/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/neon-http/index.ts +++ b/drizzle-orm/src/neon-http/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/neon-http/migrator.ts b/drizzle-orm/src/neon-http/migrator.ts index ae4a2eb1f..b56d5f7d6 100644 --- a/drizzle-orm/src/neon-http/migrator.ts +++ b/drizzle-orm/src/neon-http/migrator.ts @@ -1,7 +1,7 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import { type SQL, sql } from '~/sql'; -import { type NeonHttpDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import { type SQL, sql } from '~/sql/index.ts'; +import { type NeonHttpDatabase } from './driver.ts'; /** * This function reads migrationFolder and execute each unapplied migration and mark it as executed in database @@ -42,8 +42,8 @@ export async function migrate>( } rowsToInsert.push( - sql`insert into "drizzle"."__drizzle_migrations" ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})` - ) + sql`insert into "drizzle"."__drizzle_migrations" ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})`, + ); } } diff --git a/drizzle-orm/src/neon-http/session.ts b/drizzle-orm/src/neon-http/session.ts index 792c23530..e12cb014c 100644 --- a/drizzle-orm/src/neon-http/session.ts +++ b/drizzle-orm/src/neon-http/session.ts @@ -1,15 +1,15 @@ import { type FullQueryResults, type QueryRows } from '@neondatabase/serverless'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { PgTransaction } from '~/pg-core'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session'; -import { PgSession, PreparedQuery } from '~/pg-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query } from '~/sql'; -import { type Assume, mapResultRow } from '~/utils'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import { PgTransaction } from '~/pg-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session.ts'; +import { PgSession, PreparedQuery } from '~/pg-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query } from '~/sql/index.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; export type NeonHttpClient = { ( @@ -24,8 +24,8 @@ export type NeonHttpClient = { export class NeonHttpPreparedQuery extends PreparedQuery { static readonly [entityKind]: string = 'NeonHttpPreparedQuery'; - private rawQuery: { arrayMode?: false, fullResults?: true }; - private query: { arrayMode?: true, fullResults?: true }; + private rawQuery: { arrayMode?: false; fullResults?: true }; + private query: { arrayMode?: true; fullResults?: true }; constructor( private client: NeonHttpClient, diff --git a/drizzle-orm/src/neon-serverless/driver.ts b/drizzle-orm/src/neon-serverless/driver.ts index dd4c0b3ac..a90213d56 100644 --- a/drizzle-orm/src/neon-serverless/driver.ts +++ b/drizzle-orm/src/neon-serverless/driver.ts @@ -1,18 +1,18 @@ import { types } from '@neondatabase/serverless'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { PgDatabase } from '~/pg-core/db'; -import { PgDialect } from '~/pg-core/dialect'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { PgDatabase } from '~/pg-core/db.ts'; +import { PgDialect } from '~/pg-core/dialect.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import type { NeonClient, NeonQueryResultHKT } from './session'; -import { NeonSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import type { NeonClient, NeonQueryResultHKT } from './session.ts'; +import { NeonSession } from './session.ts'; export interface NeonDriverOptions { logger?: Logger; diff --git a/drizzle-orm/src/neon-serverless/index.ts b/drizzle-orm/src/neon-serverless/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/neon-serverless/index.ts +++ b/drizzle-orm/src/neon-serverless/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/neon-serverless/migrator.ts b/drizzle-orm/src/neon-serverless/migrator.ts index 422702f26..80453b035 100644 --- a/drizzle-orm/src/neon-serverless/migrator.ts +++ b/drizzle-orm/src/neon-serverless/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { NeonDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { NeonDatabase } from './driver.ts'; export async function migrate>( db: NeonDatabase, diff --git a/drizzle-orm/src/neon-serverless/session.ts b/drizzle-orm/src/neon-serverless/session.ts index 2f8a11466..7e47bc093 100644 --- a/drizzle-orm/src/neon-serverless/session.ts +++ b/drizzle-orm/src/neon-serverless/session.ts @@ -7,17 +7,17 @@ import { type QueryResult, type QueryResultRow, } from '@neondatabase/serverless'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { PgTransaction } from '~/pg-core'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session'; -import { PgSession, PreparedQuery } from '~/pg-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { type Assume, mapResultRow } from '~/utils'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import { PgTransaction } from '~/pg-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session.ts'; +import { PgSession, PreparedQuery } from '~/pg-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; export type NeonClient = Pool | PoolClient | Client; diff --git a/drizzle-orm/src/node-postgres/driver.ts b/drizzle-orm/src/node-postgres/driver.ts index 42ae7126c..5ad20ce23 100644 --- a/drizzle-orm/src/node-postgres/driver.ts +++ b/drizzle-orm/src/node-postgres/driver.ts @@ -1,18 +1,18 @@ import pg from 'pg'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { PgDatabase } from '~/pg-core/db'; -import { PgDialect } from '~/pg-core/dialect'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { PgDatabase } from '~/pg-core/db.ts'; +import { PgDialect } from '~/pg-core/dialect.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import type { NodePgClient, NodePgQueryResultHKT } from './session'; -import { NodePgSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import type { NodePgClient, NodePgQueryResultHKT } from './session.ts'; +import { NodePgSession } from './session.ts'; const { types } = pg; diff --git a/drizzle-orm/src/node-postgres/index.ts b/drizzle-orm/src/node-postgres/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/node-postgres/index.ts +++ b/drizzle-orm/src/node-postgres/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/node-postgres/migrator.ts b/drizzle-orm/src/node-postgres/migrator.ts index da3fc7d10..1e301c1c3 100644 --- a/drizzle-orm/src/node-postgres/migrator.ts +++ b/drizzle-orm/src/node-postgres/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { NodePgDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { NodePgDatabase } from './driver.ts'; export async function migrate>( db: NodePgDatabase, diff --git a/drizzle-orm/src/node-postgres/session.ts b/drizzle-orm/src/node-postgres/session.ts index 878a969ce..eac168c7e 100644 --- a/drizzle-orm/src/node-postgres/session.ts +++ b/drizzle-orm/src/node-postgres/session.ts @@ -1,16 +1,16 @@ import type { Client, PoolClient, QueryArrayConfig, QueryConfig, QueryResult, QueryResultRow } from 'pg'; import pg from 'pg'; -import { entityKind } from '~/entity'; -import { type Logger, NoopLogger } from '~/logger'; -import { PgTransaction } from '~/pg-core'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session'; -import { PgSession, PreparedQuery } from '~/pg-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { tracer } from '~/tracing'; -import { type Assume, mapResultRow } from '~/utils'; +import { entityKind } from '~/entity.ts'; +import { type Logger, NoopLogger } from '~/logger.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import { PgTransaction } from '~/pg-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session.ts'; +import { PgSession, PreparedQuery } from '~/pg-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import { tracer } from '~/tracing.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; const { Pool } = pg; diff --git a/drizzle-orm/src/operations.ts b/drizzle-orm/src/operations.ts index f63cd8012..19927cd94 100644 --- a/drizzle-orm/src/operations.ts +++ b/drizzle-orm/src/operations.ts @@ -1,6 +1,6 @@ -import type { AnyColumn, Column } from './column'; -import type { SQL } from './sql'; -import type { Table } from './table'; +import type { AnyColumn, Column } from './column.ts'; +import type { SQL } from './sql/index.ts'; +import type { Table } from './table.ts'; export type RequiredKeyOnly = T extends AnyColumn<{ notNull: true; diff --git a/drizzle-orm/src/pg-core/alias.ts b/drizzle-orm/src/pg-core/alias.ts index 4564c2123..2d9800e7e 100644 --- a/drizzle-orm/src/pg-core/alias.ts +++ b/drizzle-orm/src/pg-core/alias.ts @@ -1,8 +1,8 @@ -import { TableAliasProxyHandler } from '~/alias'; -import type { BuildAliasTable } from './query-builders/select.types'; +import { TableAliasProxyHandler } from '~/alias.ts'; +import type { BuildAliasTable } from './query-builders/select.types.ts'; -import type { PgTable } from './table'; -import { type PgViewBase } from './view'; +import type { PgTable } from './table.ts'; +import { type PgViewBase } from './view.ts'; export function alias( table: TTable, diff --git a/drizzle-orm/src/pg-core/checks.ts b/drizzle-orm/src/pg-core/checks.ts index 5801f69ac..43740427b 100644 --- a/drizzle-orm/src/pg-core/checks.ts +++ b/drizzle-orm/src/pg-core/checks.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { SQL } from '~/sql'; -import type { PgTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { SQL } from '~/sql/index.ts'; +import type { PgTable } from './table.ts'; export class CheckBuilder { static readonly [entityKind]: string = 'PgCheckBuilder'; diff --git a/drizzle-orm/src/pg-core/columns/array.ts b/drizzle-orm/src/pg-core/columns/array.ts index f0c02f6fb..4106f18d5 100644 --- a/drizzle-orm/src/pg-core/columns/array.ts +++ b/drizzle-orm/src/pg-core/columns/array.ts @@ -1,14 +1,14 @@ -import type { ColumnBaseConfig } from '~/column'; import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, ColumnDataType, MakeColumnConfig, -} from '~/column-builder'; -import { entityKind, is } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { makePgArray, parsePgArray } from '../utils'; -import { PgColumn, PgColumnBuilder } from './common'; +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind, is } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { makePgArray, parsePgArray } from '../utils.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export class PgArrayBuilder< T extends ColumnBuilderBaseConfig<'array', 'PgArray'>, diff --git a/drizzle-orm/src/pg-core/columns/bigint.ts b/drizzle-orm/src/pg-core/columns/bigint.ts index 8d781256f..af2d8b036 100644 --- a/drizzle-orm/src/pg-core/columns/bigint.ts +++ b/drizzle-orm/src/pg-core/columns/bigint.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; -import { PgColumn, PgColumnBuilder } from './common'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgBigInt53BuilderInitial = PgBigInt53Builder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/bigserial.ts b/drizzle-orm/src/pg-core/columns/bigserial.ts index 3cb0324d2..69917678f 100644 --- a/drizzle-orm/src/pg-core/columns/bigserial.ts +++ b/drizzle-orm/src/pg-core/columns/bigserial.ts @@ -1,14 +1,14 @@ -import type { ColumnBaseConfig } from '~/column'; import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, HasDefault, MakeColumnConfig, NotNull, -} from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '../table'; -import { PgColumn, PgColumnBuilder } from './common'; +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '../table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgBigSerial53BuilderInitial = NotNull< HasDefault< diff --git a/drizzle-orm/src/pg-core/columns/boolean.ts b/drizzle-orm/src/pg-core/columns/boolean.ts index 540a073e7..83135e3de 100644 --- a/drizzle-orm/src/pg-core/columns/boolean.ts +++ b/drizzle-orm/src/pg-core/columns/boolean.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgBooleanBuilderInitial = PgBooleanBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/char.ts b/drizzle-orm/src/pg-core/columns/char.ts index 95a853501..1c5d88416 100644 --- a/drizzle-orm/src/pg-core/columns/char.ts +++ b/drizzle-orm/src/pg-core/columns/char.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { type Writable } from '~/utils'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgCharBuilderInitial = PgCharBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/cidr.ts b/drizzle-orm/src/pg-core/columns/cidr.ts index 8761c311c..2f37d0348 100644 --- a/drizzle-orm/src/pg-core/columns/cidr.ts +++ b/drizzle-orm/src/pg-core/columns/cidr.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '../table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '../table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgCidrBuilderInitial = PgCidrBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/common.ts b/drizzle-orm/src/pg-core/columns/common.ts index 3dd1e6923..6e71fec17 100644 --- a/drizzle-orm/src/pg-core/columns/common.ts +++ b/drizzle-orm/src/pg-core/columns/common.ts @@ -1,21 +1,22 @@ -import type { ColumnBaseConfig } from '~/column'; -import { Column } from '~/column'; import type { + ColumnBuilderBase, ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnBuilderRuntimeConfig, ColumnDataType, MakeColumnConfig, -} from '~/column-builder'; -import { ColumnBuilder } from '~/column-builder'; -import { entityKind } from '~/entity'; -import { iife, type Update } from '~/utils'; +} from '~/column-builder.ts'; +import { ColumnBuilder } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { Column } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import { iife, type Update } from '~/utils.ts'; -import type { ForeignKey, UpdateDeleteAction } from '~/pg-core/foreign-keys'; -import { ForeignKeyBuilder } from '~/pg-core/foreign-keys'; -import type { AnyPgTable, PgTable } from '~/pg-core/table'; -import { uniqueKeyName } from '../unique-constraint'; -import { PgArrayBuilder } from './array'; +import type { ForeignKey, UpdateDeleteAction } from '~/pg-core/foreign-keys.ts'; +import { ForeignKeyBuilder } from '~/pg-core/foreign-keys.ts'; +import type { AnyPgTable, PgTable } from '~/pg-core/table.ts'; +import { uniqueKeyName } from '../unique-constraint.ts'; +import { PgArrayBuilder } from './array.ts'; export interface ReferenceConfig { ref: () => PgColumn; @@ -25,14 +26,19 @@ export interface ReferenceConfig { }; } +export interface PgColumnBuilderBase< + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, + TTypeConfig extends object = object, +> extends ColumnBuilderBase {} + export abstract class PgColumnBuilder< - T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig & { - data: any; - }, + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig, -> extends ColumnBuilder { +> extends ColumnBuilder + implements PgColumnBuilderBase +{ private foreignKeyConfigs: ReferenceConfig[] = []; static readonly [entityKind]: string = 'PgColumnBuilder'; diff --git a/drizzle-orm/src/pg-core/columns/custom.ts b/drizzle-orm/src/pg-core/columns/custom.ts index feb3703f9..ff768d0ae 100644 --- a/drizzle-orm/src/pg-core/columns/custom.ts +++ b/drizzle-orm/src/pg-core/columns/custom.ts @@ -1,10 +1,10 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import type { SQL } from '~/sql'; -import { type Equal } from '~/utils'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import type { SQL } from '~/sql/index.ts'; +import { type Equal } from '~/utils.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type ConvertCustomConfig> = & { diff --git a/drizzle-orm/src/pg-core/columns/date.common.ts b/drizzle-orm/src/pg-core/columns/date.common.ts index 1e283c294..afae5bb67 100644 --- a/drizzle-orm/src/pg-core/columns/date.common.ts +++ b/drizzle-orm/src/pg-core/columns/date.common.ts @@ -1,7 +1,7 @@ -import type { ColumnBuilderBaseConfig, ColumnDataType } from '~/column-builder'; -import { entityKind } from '~/entity'; -import { sql } from '~/sql'; -import { PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnDataType } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import { sql } from '~/sql/index.ts'; +import { PgColumnBuilder } from './common.ts'; export abstract class PgDateColumnBaseBuilder< T extends ColumnBuilderBaseConfig, diff --git a/drizzle-orm/src/pg-core/columns/date.ts b/drizzle-orm/src/pg-core/columns/date.ts index e276478fe..61f56810a 100644 --- a/drizzle-orm/src/pg-core/columns/date.ts +++ b/drizzle-orm/src/pg-core/columns/date.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn } from './common'; -import { PgDateColumnBaseBuilder } from './date.common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn } from './common.ts'; +import { PgDateColumnBaseBuilder } from './date.common.ts'; export type PgDateBuilderInitial = PgDateBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/double-precision.ts b/drizzle-orm/src/pg-core/columns/double-precision.ts index aa5a41d50..a6bbdc6ff 100644 --- a/drizzle-orm/src/pg-core/columns/double-precision.ts +++ b/drizzle-orm/src/pg-core/columns/double-precision.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgDoublePrecisionBuilderInitial = PgDoublePrecisionBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/enum.ts b/drizzle-orm/src/pg-core/columns/enum.ts index 7a70d7ca9..dcae97545 100644 --- a/drizzle-orm/src/pg-core/columns/enum.ts +++ b/drizzle-orm/src/pg-core/columns/enum.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { type Writable } from '~/utils'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgEnumColumnBuilderInitial = PgEnumColumnBuilder<{ diff --git a/drizzle-orm/src/pg-core/columns/index.ts b/drizzle-orm/src/pg-core/columns/index.ts index 7615d713c..a87315a1f 100644 --- a/drizzle-orm/src/pg-core/columns/index.ts +++ b/drizzle-orm/src/pg-core/columns/index.ts @@ -1,28 +1,28 @@ -export * from './array'; -export * from './bigint'; -export * from './bigserial'; -export * from './boolean'; -export * from './char'; -export * from './cidr'; -export * from './common'; -export * from './custom'; -export * from './date'; -export * from './double-precision'; -export * from './enum'; -export * from './inet'; -export * from './integer'; -export * from './interval'; -export * from './json'; -export * from './jsonb'; -export * from './macaddr'; -export * from './macaddr8'; -export * from './numeric'; -export * from './real'; -export * from './serial'; -export * from './smallint'; -export * from './smallserial'; -export * from './text'; -export * from './time'; -export * from './timestamp'; -export * from './uuid'; -export * from './varchar'; +export * from './array.ts'; +export * from './bigint.ts'; +export * from './bigserial.ts'; +export * from './boolean.ts'; +export * from './char.ts'; +export * from './cidr.ts'; +export * from './common.ts'; +export * from './custom.ts'; +export * from './date.ts'; +export * from './double-precision.ts'; +export * from './enum.ts'; +export * from './inet.ts'; +export * from './integer.ts'; +export * from './interval.ts'; +export * from './json.ts'; +export * from './jsonb.ts'; +export * from './macaddr.ts'; +export * from './macaddr8.ts'; +export * from './numeric.ts'; +export * from './real.ts'; +export * from './serial.ts'; +export * from './smallint.ts'; +export * from './smallserial.ts'; +export * from './text.ts'; +export * from './time.ts'; +export * from './timestamp.ts'; +export * from './uuid.ts'; +export * from './varchar.ts'; diff --git a/drizzle-orm/src/pg-core/columns/inet.ts b/drizzle-orm/src/pg-core/columns/inet.ts index 11a2a3e89..cdca1797d 100644 --- a/drizzle-orm/src/pg-core/columns/inet.ts +++ b/drizzle-orm/src/pg-core/columns/inet.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '../table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '../table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgInetBuilderInitial = PgInetBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/integer.ts b/drizzle-orm/src/pg-core/columns/integer.ts index f232037c6..3ef9e248c 100644 --- a/drizzle-orm/src/pg-core/columns/integer.ts +++ b/drizzle-orm/src/pg-core/columns/integer.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '../table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '../table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; type PgIntegerBuilderInitial = PgIntegerBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/interval.ts b/drizzle-orm/src/pg-core/columns/interval.ts index ce1307eba..c8b77d9a2 100644 --- a/drizzle-orm/src/pg-core/columns/interval.ts +++ b/drizzle-orm/src/pg-core/columns/interval.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; -import type { Precision } from './timestamp'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; +import type { Precision } from './timestamp.ts'; export type PgIntervalBuilderInitial = PgIntervalBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/json.ts b/drizzle-orm/src/pg-core/columns/json.ts index 0e397e93c..c6c869eb7 100644 --- a/drizzle-orm/src/pg-core/columns/json.ts +++ b/drizzle-orm/src/pg-core/columns/json.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgJsonBuilderInitial = PgJsonBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/jsonb.ts b/drizzle-orm/src/pg-core/columns/jsonb.ts index 957cc8bc2..38d346b17 100644 --- a/drizzle-orm/src/pg-core/columns/jsonb.ts +++ b/drizzle-orm/src/pg-core/columns/jsonb.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgJsonbBuilderInitial = PgJsonbBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/macaddr.ts b/drizzle-orm/src/pg-core/columns/macaddr.ts index fa7d5a9e3..189a56187 100644 --- a/drizzle-orm/src/pg-core/columns/macaddr.ts +++ b/drizzle-orm/src/pg-core/columns/macaddr.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '../table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '../table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgMacaddrBuilderInitial = PgMacaddrBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/macaddr8.ts b/drizzle-orm/src/pg-core/columns/macaddr8.ts index 1c4d00010..cb78fc0b4 100644 --- a/drizzle-orm/src/pg-core/columns/macaddr8.ts +++ b/drizzle-orm/src/pg-core/columns/macaddr8.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '../table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '../table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgMacaddr8BuilderInitial = PgMacaddr8Builder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/numeric.ts b/drizzle-orm/src/pg-core/columns/numeric.ts index b908bd9fe..e3ea778e4 100644 --- a/drizzle-orm/src/pg-core/columns/numeric.ts +++ b/drizzle-orm/src/pg-core/columns/numeric.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgNumericBuilderInitial = PgNumericBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/real.ts b/drizzle-orm/src/pg-core/columns/real.ts index e4e62662c..9059384db 100644 --- a/drizzle-orm/src/pg-core/columns/real.ts +++ b/drizzle-orm/src/pg-core/columns/real.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgRealBuilderInitial = PgRealBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/serial.ts b/drizzle-orm/src/pg-core/columns/serial.ts index 5ab9cf526..b4ac9ed6b 100644 --- a/drizzle-orm/src/pg-core/columns/serial.ts +++ b/drizzle-orm/src/pg-core/columns/serial.ts @@ -1,14 +1,14 @@ -import type { ColumnBaseConfig } from '~/column'; import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, HasDefault, MakeColumnConfig, NotNull, -} from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgSerialBuilderInitial = NotNull< HasDefault< diff --git a/drizzle-orm/src/pg-core/columns/smallint.ts b/drizzle-orm/src/pg-core/columns/smallint.ts index fc8b0d987..23c5d47f6 100644 --- a/drizzle-orm/src/pg-core/columns/smallint.ts +++ b/drizzle-orm/src/pg-core/columns/smallint.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgSmallIntBuilderInitial = PgSmallIntBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/smallserial.ts b/drizzle-orm/src/pg-core/columns/smallserial.ts index f88a08855..b12cad4b0 100644 --- a/drizzle-orm/src/pg-core/columns/smallserial.ts +++ b/drizzle-orm/src/pg-core/columns/smallserial.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgSmallSerialBuilderInitial = PgSmallSerialBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/text.ts b/drizzle-orm/src/pg-core/columns/text.ts index cbe78da48..946d5f3cb 100644 --- a/drizzle-orm/src/pg-core/columns/text.ts +++ b/drizzle-orm/src/pg-core/columns/text.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { type Writable } from '~/utils'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; type PgTextBuilderInitial = PgTextBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/time.ts b/drizzle-orm/src/pg-core/columns/time.ts index 432d85a8a..ff7772bb0 100644 --- a/drizzle-orm/src/pg-core/columns/time.ts +++ b/drizzle-orm/src/pg-core/columns/time.ts @@ -1,10 +1,10 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { PgColumn } from './common'; -import { PgDateColumnBaseBuilder } from './date.common'; -import type { Precision } from './timestamp'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { PgColumn } from './common.ts'; +import { PgDateColumnBaseBuilder } from './date.common.ts'; +import type { Precision } from './timestamp.ts'; export type PgTimeBuilderInitial = PgTimeBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/timestamp.ts b/drizzle-orm/src/pg-core/columns/timestamp.ts index f6b7ee839..92a2f4be1 100644 --- a/drizzle-orm/src/pg-core/columns/timestamp.ts +++ b/drizzle-orm/src/pg-core/columns/timestamp.ts @@ -1,10 +1,10 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { type Equal } from '~/utils'; -import { PgColumn } from './common'; -import { PgDateColumnBaseBuilder } from './date.common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { type Equal } from '~/utils.ts'; +import { PgColumn } from './common.ts'; +import { PgDateColumnBaseBuilder } from './date.common.ts'; export type PgTimestampBuilderInitial = PgTimestampBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/uuid.ts b/drizzle-orm/src/pg-core/columns/uuid.ts index 76dde868d..f9fe9e808 100644 --- a/drizzle-orm/src/pg-core/columns/uuid.ts +++ b/drizzle-orm/src/pg-core/columns/uuid.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { sql } from '~/sql'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { sql } from '~/sql/index.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgUUIDBuilderInitial = PgUUIDBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/columns/varchar.ts b/drizzle-orm/src/pg-core/columns/varchar.ts index 61cf43df8..488a605b8 100644 --- a/drizzle-orm/src/pg-core/columns/varchar.ts +++ b/drizzle-orm/src/pg-core/columns/varchar.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnyPgTable } from '~/pg-core/table'; -import { type Writable } from '~/utils'; -import { PgColumn, PgColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgTable } from '~/pg-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { PgColumn, PgColumnBuilder } from './common.ts'; export type PgVarcharBuilderInitial = PgVarcharBuilder<{ name: TName; diff --git a/drizzle-orm/src/pg-core/db.ts b/drizzle-orm/src/pg-core/db.ts index d315331dd..4ac6575ed 100644 --- a/drizzle-orm/src/pg-core/db.ts +++ b/drizzle-orm/src/pg-core/db.ts @@ -1,20 +1,36 @@ -import { entityKind } from '~/entity'; -import type { PgDialect } from '~/pg-core/dialect'; -import { PgDelete, PgInsertBuilder, PgSelectBuilder, PgUpdateBuilder, QueryBuilder } from '~/pg-core/query-builders'; -import type { PgSession, PgTransaction, PgTransactionConfig, QueryResultHKT, QueryResultKind } from '~/pg-core/session'; -import { type PgTable } from '~/pg-core/table'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import { type ExtractTablesWithRelations, type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { type SQLWrapper } from '~/sql'; -import { SelectionProxyHandler, WithSubquery } from '~/subquery'; -import { type DrizzleTypeError } from '~/utils'; -import { type ColumnsSelection } from '~/view'; -import { type PgColumn } from './columns'; -import { RelationalQueryBuilder } from './query-builders/query'; -import { PgRefreshMaterializedView } from './query-builders/refresh-materialized-view'; -import type { SelectedFields } from './query-builders/select.types'; -import type { WithSubqueryWithSelection } from './subquery'; -import type { PgMaterializedView } from './view'; +import { entityKind } from '~/entity.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import { + PgDelete, + PgInsertBuilder, + PgSelectBuilder, + PgUpdateBuilder, + QueryBuilder, +} from '~/pg-core/query-builders/index.ts'; +import type { + PgSession, + PgTransaction, + PgTransactionConfig, + QueryResultHKT, + QueryResultKind, +} from '~/pg-core/session.ts'; +import { type PgTable } from '~/pg-core/table.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import { + type ExtractTablesWithRelations, + type RelationalSchemaConfig, + type TablesRelationalConfig, +} from '~/relations.ts'; +import { type SQLWrapper } from '~/sql/index.ts'; +import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; +import { type DrizzleTypeError } from '~/utils.ts'; +import { type ColumnsSelection } from '~/view.ts'; +import { type PgColumn } from './columns/index.ts'; +import { RelationalQueryBuilder } from './query-builders/query.ts'; +import { PgRefreshMaterializedView } from './query-builders/refresh-materialized-view.ts'; +import type { SelectedFields } from './query-builders/select.types.ts'; +import type { WithSubqueryWithSelection } from './subquery.ts'; +import type { PgMaterializedView } from './view.ts'; export class PgDatabase< TQueryResult extends QueryResultHKT, diff --git a/drizzle-orm/src/pg-core/dialect.ts b/drizzle-orm/src/pg-core/dialect.ts index d9081dd1c..0dcdf53e2 100644 --- a/drizzle-orm/src/pg-core/dialect.ts +++ b/drizzle-orm/src/pg-core/dialect.ts @@ -1,12 +1,12 @@ -import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from '~/alias'; -import { Column } from '~/column'; -import { entityKind, is } from '~/entity'; -import { DrizzleError } from '~/errors'; -import type { MigrationMeta } from '~/migrator'; -import { PgColumn, PgDate, PgJson, PgJsonb, PgNumeric, PgTime, PgTimestamp, PgUUID } from '~/pg-core/columns'; -import type { PgDeleteConfig, PgInsertConfig, PgUpdateConfig } from '~/pg-core/query-builders'; -import type { Join, PgSelectConfig, SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import { PgTable } from '~/pg-core/table'; +import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from '~/alias.ts'; +import { Column } from '~/column.ts'; +import { entityKind, is } from '~/entity.ts'; +import { DrizzleError } from '~/errors.ts'; +import type { MigrationMeta } from '~/migrator.ts'; +import { PgColumn, PgDate, PgJson, PgJsonb, PgNumeric, PgTime, PgTimestamp, PgUUID } from '~/pg-core/columns/index.ts'; +import type { PgDeleteConfig, PgInsertConfig, PgUpdateConfig } from '~/pg-core/query-builders/index.ts'; +import type { Join, PgSelectConfig, SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import { PgTable } from '~/pg-core/table.ts'; import { type BuildRelationalQueryResult, type DBQueryConfig, @@ -18,7 +18,7 @@ import { type Relation, type TableRelationalConfig, type TablesRelationalConfig, -} from '~/relations'; +} from '~/relations.ts'; import { and, type DriverValueEncoder, @@ -29,13 +29,13 @@ import { SQL, sql, type SQLChunk, -} from '~/sql'; -import { Subquery, SubqueryConfig } from '~/subquery'; -import { getTableName, Table } from '~/table'; -import { orderSelectedFields, type UpdateSet } from '~/utils'; -import { View, ViewBaseConfig } from '~/view'; -import type { PgSession } from './session'; -import { type PgMaterializedView, PgViewBase } from './view'; +} from '~/sql/index.ts'; +import { Subquery, SubqueryConfig } from '~/subquery.ts'; +import { getTableName, Table } from '~/table.ts'; +import { orderSelectedFields, type UpdateSet } from '~/utils.ts'; +import { View, ViewBaseConfig } from '~/view.ts'; +import type { PgSession } from './session.ts'; +import { type PgMaterializedView, PgViewBase } from './view.ts'; export class PgDialect { static readonly [entityKind]: string = 'PgDialect'; diff --git a/drizzle-orm/src/pg-core/expressions.ts b/drizzle-orm/src/pg-core/expressions.ts index 4d64b1bd7..e410587b4 100644 --- a/drizzle-orm/src/pg-core/expressions.ts +++ b/drizzle-orm/src/pg-core/expressions.ts @@ -1,9 +1,9 @@ -import { bindIfParam } from '~/expressions'; -import type { PgColumn } from '~/pg-core/columns'; -import type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql'; -import { sql } from '~/sql'; +import { bindIfParam } from '~/expressions.ts'; +import type { PgColumn } from '~/pg-core/columns/index.ts'; +import type { Placeholder, SQL, SQLChunk, SQLWrapper } from '~/sql/index.ts'; +import { sql } from '~/sql/index.ts'; -export * from '~/expressions'; +export * from '~/expressions.ts'; export function concat(column: PgColumn | SQL.Aliased, value: string | Placeholder | SQLWrapper): SQL { return sql`${column} || ${bindIfParam(value, column)}`; diff --git a/drizzle-orm/src/pg-core/foreign-keys.ts b/drizzle-orm/src/pg-core/foreign-keys.ts index 2473d5fec..31fc00d41 100644 --- a/drizzle-orm/src/pg-core/foreign-keys.ts +++ b/drizzle-orm/src/pg-core/foreign-keys.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { AnyPgColumn, PgColumn } from './columns'; -import { PgTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgColumn, PgColumn } from './columns/index.ts'; +import { PgTable } from './table.ts'; export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default'; diff --git a/drizzle-orm/src/pg-core/index.ts b/drizzle-orm/src/pg-core/index.ts index 0582ea974..7120e0c5c 100644 --- a/drizzle-orm/src/pg-core/index.ts +++ b/drizzle-orm/src/pg-core/index.ts @@ -1,16 +1,16 @@ -export * from './alias'; -export * from './checks'; -export * from './columns'; -export * from './db'; -export * from './dialect'; -export * from './foreign-keys'; -export * from './indexes'; -export * from './primary-keys'; -export * from './unique-constraint'; -export * from './query-builders'; -export * from './schema'; -export * from './session'; -export * from './subquery'; -export * from './table'; -export * from './utils'; -export * from './view'; +export * from './alias.ts'; +export * from './checks.ts'; +export * from './columns/index.ts'; +export * from './db.ts'; +export * from './dialect.ts'; +export * from './foreign-keys.ts'; +export * from './indexes.ts'; +export * from './primary-keys.ts'; +export * from './query-builders/index.ts'; +export * from './schema.ts'; +export * from './session.ts'; +export * from './subquery.ts'; +export * from './table.ts'; +export * from './unique-constraint.ts'; +export * from './utils.ts'; +export * from './view.ts'; diff --git a/drizzle-orm/src/pg-core/indexes.ts b/drizzle-orm/src/pg-core/indexes.ts index e2a980959..d4ecaf535 100644 --- a/drizzle-orm/src/pg-core/indexes.ts +++ b/drizzle-orm/src/pg-core/indexes.ts @@ -1,8 +1,8 @@ -import type { SQL } from '~/sql'; +import type { SQL } from '~/sql/index.ts'; -import { entityKind } from '~/entity'; -import type { PgColumn } from './columns'; -import type { PgTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { PgColumn } from './columns/index.ts'; +import type { PgTable } from './table.ts'; interface IndexConfig { name?: string; diff --git a/drizzle-orm/src/pg-core/primary-keys.ts b/drizzle-orm/src/pg-core/primary-keys.ts index 3b56a8a07..113471192 100644 --- a/drizzle-orm/src/pg-core/primary-keys.ts +++ b/drizzle-orm/src/pg-core/primary-keys.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { AnyPgColumn, PgColumn } from './columns'; -import { PgTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { AnyPgColumn, PgColumn } from './columns/index.ts'; +import { PgTable } from './table.ts'; export function primaryKey< TTableName extends string, diff --git a/drizzle-orm/src/pg-core/query-builders/delete.ts b/drizzle-orm/src/pg-core/query-builders/delete.ts index e10636c1d..b9716c692 100644 --- a/drizzle-orm/src/pg-core/query-builders/delete.ts +++ b/drizzle-orm/src/pg-core/query-builders/delete.ts @@ -1,14 +1,20 @@ -import { entityKind } from '~/entity'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { PgSession, PreparedQuery, PreparedQueryConfig, QueryResultHKT, QueryResultKind } from '~/pg-core/session'; -import type { PgTable } from '~/pg-core/table'; -import type { SelectResultFields } from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL, SQLWrapper } from '~/sql'; -import { type InferModel, Table } from '~/table'; -import { tracer } from '~/tracing'; -import { orderSelectedFields } from '~/utils'; -import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types'; +import { entityKind } from '~/entity.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import type { + PgSession, + PreparedQuery, + PreparedQueryConfig, + QueryResultHKT, + QueryResultKind, +} from '~/pg-core/session.ts'; +import type { PgTable } from '~/pg-core/table.ts'; +import type { SelectResultFields } from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL, SQLWrapper } from '~/sql/index.ts'; +import { type InferModel, Table } from '~/table.ts'; +import { tracer } from '~/tracing.ts'; +import { orderSelectedFields } from '~/utils.ts'; +import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types.ts'; export interface PgDeleteConfig { where?: SQL | undefined; diff --git a/drizzle-orm/src/pg-core/query-builders/index.ts b/drizzle-orm/src/pg-core/query-builders/index.ts index ff344647e..c4821e51d 100644 --- a/drizzle-orm/src/pg-core/query-builders/index.ts +++ b/drizzle-orm/src/pg-core/query-builders/index.ts @@ -1,7 +1,7 @@ -export * from './delete'; -export * from './insert'; -export * from './query-builder'; -export * from './refresh-materialized-view'; -export * from './select'; -export * from './select.types'; -export * from './update'; +export * from './delete.ts'; +export * from './insert.ts'; +export * from './query-builder.ts'; +export * from './refresh-materialized-view.ts'; +export * from './select.ts'; +export * from './select.types.ts'; +export * from './update.ts'; diff --git a/drizzle-orm/src/pg-core/query-builders/insert.ts b/drizzle-orm/src/pg-core/query-builders/insert.ts index 90dd6e984..d6cd6c7f9 100644 --- a/drizzle-orm/src/pg-core/query-builders/insert.ts +++ b/drizzle-orm/src/pg-core/query-builders/insert.ts @@ -1,17 +1,23 @@ -import { entityKind, is } from '~/entity'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { IndexColumn } from '~/pg-core/indexes'; -import type { PgSession, PreparedQuery, PreparedQueryConfig, QueryResultHKT, QueryResultKind } from '~/pg-core/session'; -import type { PgTable } from '~/pg-core/table'; -import type { SelectResultFields } from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { Placeholder, Query, SQLWrapper } from '~/sql'; -import { Param, SQL, sql } from '~/sql'; -import { type InferModel, Table } from '~/table'; -import { tracer } from '~/tracing'; -import { mapUpdateSet, orderSelectedFields } from '~/utils'; -import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types'; -import type { PgUpdateSetSource } from './update'; +import { entityKind, is } from '~/entity.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import type { IndexColumn } from '~/pg-core/indexes.ts'; +import type { + PgSession, + PreparedQuery, + PreparedQueryConfig, + QueryResultHKT, + QueryResultKind, +} from '~/pg-core/session.ts'; +import type { PgTable } from '~/pg-core/table.ts'; +import type { SelectResultFields } from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Placeholder, Query, SQLWrapper } from '~/sql/index.ts'; +import { Param, SQL, sql } from '~/sql/index.ts'; +import { type InferModel, Table } from '~/table.ts'; +import { tracer } from '~/tracing.ts'; +import { mapUpdateSet, orderSelectedFields } from '~/utils.ts'; +import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types.ts'; +import type { PgUpdateSetSource } from './update.ts'; export interface PgInsertConfig { table: TTable; diff --git a/drizzle-orm/src/pg-core/query-builders/query-builder.ts b/drizzle-orm/src/pg-core/query-builders/query-builder.ts index a63410d8c..d0b6590c1 100644 --- a/drizzle-orm/src/pg-core/query-builders/query-builder.ts +++ b/drizzle-orm/src/pg-core/query-builders/query-builder.ts @@ -1,13 +1,13 @@ -import { entityKind } from '~/entity'; -import { PgDialect } from '~/pg-core/dialect'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import { type SQLWrapper } from '~/sql'; -import { SelectionProxyHandler, WithSubquery } from '~/subquery'; -import { type ColumnsSelection } from '~/view'; -import { type PgColumn } from '../columns'; -import type { WithSubqueryWithSelection } from '../subquery'; -import { PgSelectBuilder } from './select'; -import type { SelectedFields } from './select.types'; +import { entityKind } from '~/entity.ts'; +import { PgDialect } from '~/pg-core/dialect.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import { type SQLWrapper } from '~/sql/index.ts'; +import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; +import { type ColumnsSelection } from '~/view.ts'; +import { type PgColumn } from '../columns/index.ts'; +import type { WithSubqueryWithSelection } from '../subquery.ts'; +import { PgSelectBuilder } from './select.ts'; +import type { SelectedFields } from './select.types.ts'; export class QueryBuilder { static readonly [entityKind]: string = 'PgQueryBuilder'; diff --git a/drizzle-orm/src/pg-core/query-builders/query.ts b/drizzle-orm/src/pg-core/query-builders/query.ts index 5a0f389d9..9313f3d31 100644 --- a/drizzle-orm/src/pg-core/query-builders/query.ts +++ b/drizzle-orm/src/pg-core/query-builders/query.ts @@ -1,18 +1,18 @@ -import { entityKind } from '~/entity'; -import { QueryPromise } from '~/query-promise'; +import { entityKind } from '~/entity.ts'; +import { QueryPromise } from '~/query-promise.ts'; import { type BuildQueryResult, type DBQueryConfig, mapRelationalRow, type TableRelationalConfig, type TablesRelationalConfig, -} from '~/relations'; -import type { SQL } from '~/sql'; -import { tracer } from '~/tracing'; -import { type KnownKeysOnly } from '~/utils'; -import type { PgDialect } from '../dialect'; -import type { PgSession, PreparedQuery, PreparedQueryConfig } from '../session'; -import { type PgTable } from '../table'; +} from '~/relations.ts'; +import type { SQL } from '~/sql/index.ts'; +import { tracer } from '~/tracing.ts'; +import { type KnownKeysOnly } from '~/utils.ts'; +import type { PgDialect } from '../dialect.ts'; +import type { PgSession, PreparedQuery, PreparedQueryConfig } from '../session.ts'; +import { type PgTable } from '../table.ts'; export class RelationalQueryBuilder { static readonly [entityKind]: string = 'PgRelationalQueryBuilder'; diff --git a/drizzle-orm/src/pg-core/query-builders/refresh-materialized-view.ts b/drizzle-orm/src/pg-core/query-builders/refresh-materialized-view.ts index cbd4e6b33..ee843641e 100644 --- a/drizzle-orm/src/pg-core/query-builders/refresh-materialized-view.ts +++ b/drizzle-orm/src/pg-core/query-builders/refresh-materialized-view.ts @@ -1,10 +1,16 @@ -import { entityKind } from '~/entity'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { PgSession, PreparedQuery, PreparedQueryConfig, QueryResultHKT, QueryResultKind } from '~/pg-core/session'; -import type { PgMaterializedView } from '~/pg-core/view'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL } from '~/sql'; -import { tracer } from '~/tracing'; +import { entityKind } from '~/entity.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import type { + PgSession, + PreparedQuery, + PreparedQueryConfig, + QueryResultHKT, + QueryResultKind, +} from '~/pg-core/session.ts'; +import type { PgMaterializedView } from '~/pg-core/view.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL } from '~/sql/index.ts'; +import { tracer } from '~/tracing.ts'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PgRefreshMaterializedView diff --git a/drizzle-orm/src/pg-core/query-builders/select.ts b/drizzle-orm/src/pg-core/query-builders/select.ts index f7acc19f1..5b25a08c8 100644 --- a/drizzle-orm/src/pg-core/query-builders/select.ts +++ b/drizzle-orm/src/pg-core/query-builders/select.ts @@ -1,11 +1,11 @@ -import { entityKind, is } from '~/entity'; -import type { PgColumn } from '~/pg-core/columns'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { PgSession, PreparedQuery, PreparedQueryConfig } from '~/pg-core/session'; -import type { SubqueryWithSelection } from '~/pg-core/subquery'; -import type { PgTable } from '~/pg-core/table'; -import { PgViewBase } from '~/pg-core/view'; -import { TypedQueryBuilder } from '~/query-builders/query-builder'; +import { entityKind, is } from '~/entity.ts'; +import type { PgColumn } from '~/pg-core/columns/index.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import type { PgSession, PreparedQuery, PreparedQueryConfig } from '~/pg-core/session.ts'; +import type { SubqueryWithSelection } from '~/pg-core/subquery.ts'; +import type { PgTable } from '~/pg-core/table.ts'; +import { PgViewBase } from '~/pg-core/view.ts'; +import { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; import type { BuildSubquerySelection, GetSelectTableName, @@ -14,15 +14,15 @@ import type { JoinType, SelectMode, SelectResult, -} from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import { type Placeholder, type Query, SQL, type SQLWrapper } from '~/sql'; -import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery'; -import { Table } from '~/table'; -import { tracer } from '~/tracing'; -import { applyMixins, getTableColumns, getTableLikeName, type ValueOrArray } from '~/utils'; -import { orderSelectedFields } from '~/utils'; -import { type ColumnsSelection, View, ViewBaseConfig } from '~/view'; +} from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import { type Placeholder, type Query, SQL, type SQLWrapper } from '~/sql/index.ts'; +import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery.ts'; +import { Table } from '~/table.ts'; +import { tracer } from '~/tracing.ts'; +import { applyMixins, getTableColumns, getTableLikeName, type ValueOrArray } from '~/utils.ts'; +import { orderSelectedFields } from '~/utils.ts'; +import { type ColumnsSelection, View, ViewBaseConfig } from '~/view.ts'; import type { JoinFn, LockConfig, @@ -32,7 +32,7 @@ import type { PgSelectHKTBase, PgSelectQueryBuilderHKT, SelectedFields, -} from './select.types'; +} from './select.types.ts'; type CreatePgSelectFromBuilderMode< TBuilderMode extends 'db' | 'qb', diff --git a/drizzle-orm/src/pg-core/query-builders/select.types.ts b/drizzle-orm/src/pg-core/query-builders/select.types.ts index 8df87e30d..2ab6d4e62 100644 --- a/drizzle-orm/src/pg-core/query-builders/select.types.ts +++ b/drizzle-orm/src/pg-core/query-builders/select.types.ts @@ -2,10 +2,10 @@ import type { SelectedFields as SelectedFieldsBase, SelectedFieldsFlat as SelectedFieldsFlatBase, SelectedFieldsOrdered as SelectedFieldsOrderedBase, -} from '~/operations'; -import type { PgColumn } from '~/pg-core/columns'; -import type { PgTable, PgTableWithColumns } from '~/pg-core/table'; -import type { PgViewBase, PgViewWithSelection } from '~/pg-core/view'; +} from '~/operations.ts'; +import type { PgColumn } from '~/pg-core/columns/index.ts'; +import type { PgTable, PgTableWithColumns } from '~/pg-core/table.ts'; +import type { PgViewBase, PgViewWithSelection } from '~/pg-core/view.ts'; import type { AppendToNullabilityMap, AppendToResult, @@ -14,13 +14,13 @@ import type { JoinType, MapColumnsToTableAlias, SelectMode, -} from '~/query-builders/select.types'; -import type { Placeholder, SQL, SQLWrapper } from '~/sql'; -import type { Subquery } from '~/subquery'; -import type { Table, UpdateTableConfig } from '~/table'; -import type { Assume } from '~/utils'; -import { type ColumnsSelection, type View } from '~/view'; -import type { PgSelect, PgSelectQueryBuilder } from './select'; +} from '~/query-builders/select.types.ts'; +import type { Placeholder, SQL, SQLWrapper } from '~/sql/index.ts'; +import type { Subquery } from '~/subquery.ts'; +import type { Table, UpdateTableConfig } from '~/table.ts'; +import type { Assume } from '~/utils.ts'; +import { type ColumnsSelection, type View } from '~/view.ts'; +import type { PgSelect, PgSelectQueryBuilder } from './select.ts'; export interface Join { on: SQL | undefined; diff --git a/drizzle-orm/src/pg-core/query-builders/update.ts b/drizzle-orm/src/pg-core/query-builders/update.ts index fc370e4ca..4139e484b 100644 --- a/drizzle-orm/src/pg-core/query-builders/update.ts +++ b/drizzle-orm/src/pg-core/query-builders/update.ts @@ -1,14 +1,20 @@ -import type { GetColumnData } from '~/column'; -import { entityKind } from '~/entity'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { PgSession, PreparedQuery, PreparedQueryConfig, QueryResultHKT, QueryResultKind } from '~/pg-core/session'; -import type { PgTable } from '~/pg-core/table'; -import type { SelectResultFields } from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL, SQLWrapper } from '~/sql'; -import { type InferModel, Table } from '~/table'; -import { mapUpdateSet, orderSelectedFields, type UpdateSet } from '~/utils'; -import type { SelectedFields, SelectedFieldsOrdered } from './select.types'; +import type { GetColumnData } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import type { + PgSession, + PreparedQuery, + PreparedQueryConfig, + QueryResultHKT, + QueryResultKind, +} from '~/pg-core/session.ts'; +import type { PgTable } from '~/pg-core/table.ts'; +import type { SelectResultFields } from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL, SQLWrapper } from '~/sql/index.ts'; +import { type InferModel, Table } from '~/table.ts'; +import { mapUpdateSet, orderSelectedFields, type UpdateSet } from '~/utils.ts'; +import type { SelectedFields, SelectedFieldsOrdered } from './select.types.ts'; export interface PgUpdateConfig { where?: SQL | undefined; diff --git a/drizzle-orm/src/pg-core/schema.ts b/drizzle-orm/src/pg-core/schema.ts index 96632b495..5e3237428 100644 --- a/drizzle-orm/src/pg-core/schema.ts +++ b/drizzle-orm/src/pg-core/schema.ts @@ -1,6 +1,6 @@ -import { entityKind, is } from '~/entity'; -import { type PgTableFn, pgTableWithSchema } from './table'; -import { type pgMaterializedView, pgMaterializedViewWithSchema, type pgView, pgViewWithSchema } from './view'; +import { entityKind, is } from '~/entity.ts'; +import { type PgTableFn, pgTableWithSchema } from './table.ts'; +import { type pgMaterializedView, pgMaterializedViewWithSchema, type pgView, pgViewWithSchema } from './view.ts'; export class PgSchema { static readonly [entityKind]: string = 'PgSchema'; diff --git a/drizzle-orm/src/pg-core/session.ts b/drizzle-orm/src/pg-core/session.ts index 6d4b49832..87dbdc76d 100644 --- a/drizzle-orm/src/pg-core/session.ts +++ b/drizzle-orm/src/pg-core/session.ts @@ -1,11 +1,11 @@ -import { entityKind } from '~/entity'; -import { TransactionRollbackError } from '~/errors'; -import { type TablesRelationalConfig } from '~/relations'; -import { type Query, type SQL, sql } from '~/sql'; -import { tracer } from '~/tracing'; -import { PgDatabase } from './db'; -import type { PgDialect } from './dialect'; -import type { SelectedFieldsOrdered } from './query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import { TransactionRollbackError } from '~/errors.ts'; +import { type TablesRelationalConfig } from '~/relations.ts'; +import { type Query, type SQL, sql } from '~/sql/index.ts'; +import { tracer } from '~/tracing.ts'; +import { PgDatabase } from './db.ts'; +import type { PgDialect } from './dialect.ts'; +import type { SelectedFieldsOrdered } from './query-builders/select.types.ts'; export interface PreparedQueryConfig { execute: unknown; diff --git a/drizzle-orm/src/pg-core/subquery.ts b/drizzle-orm/src/pg-core/subquery.ts index 9e3565aa6..f2952628c 100644 --- a/drizzle-orm/src/pg-core/subquery.ts +++ b/drizzle-orm/src/pg-core/subquery.ts @@ -1,6 +1,6 @@ -import type { AddAliasToSelection } from '~/query-builders/select.types'; -import type { Subquery, WithSubquery } from '~/subquery'; -import { type ColumnsSelection } from '~/view'; +import type { AddAliasToSelection } from '~/query-builders/select.types.ts'; +import type { Subquery, WithSubquery } from '~/subquery.ts'; +import { type ColumnsSelection } from '~/view.ts'; export type SubqueryWithSelection = & Subquery> diff --git a/drizzle-orm/src/pg-core/table.ts b/drizzle-orm/src/pg-core/table.ts index c2ac4c8ed..0bf686cca 100644 --- a/drizzle-orm/src/pg-core/table.ts +++ b/drizzle-orm/src/pg-core/table.ts @@ -1,12 +1,12 @@ -import type { BuildColumns } from '~/column-builder'; -import { entityKind } from '~/entity'; -import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table'; -import type { CheckBuilder } from './checks'; -import type { PgColumn, PgColumnBuilder } from './columns/common'; -import type { ForeignKey, ForeignKeyBuilder } from './foreign-keys'; -import type { AnyIndexBuilder } from './indexes'; -import type { PrimaryKeyBuilder } from './primary-keys'; -import type { UniqueConstraintBuilder } from './unique-constraint'; +import type { BuildColumns } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table.ts'; +import type { CheckBuilder } from './checks.ts'; +import type { PgColumn, PgColumnBuilder, PgColumnBuilderBase } from './columns/common.ts'; +import type { ForeignKey, ForeignKeyBuilder } from './foreign-keys.ts'; +import type { AnyIndexBuilder } from './indexes.ts'; +import type { PrimaryKeyBuilder } from './primary-keys.ts'; +import type { UniqueConstraintBuilder } from './unique-constraint.ts'; export type PgTableExtraConfig = Record< string, @@ -50,7 +50,7 @@ export type PgTableWithColumns = export function pgTableWithSchema< TTableName extends string, TSchemaName extends string | undefined, - TColumnsMap extends Record, + TColumnsMap extends Record, >( name: TTableName, columns: TColumnsMap, @@ -71,7 +71,8 @@ export function pgTableWithSchema< }>(name, schema, baseName); const builtColumns = Object.fromEntries( - Object.entries(columns).map(([name, colBuilder]) => { + Object.entries(columns).map(([name, colBuilderBase]) => { + const colBuilder = colBuilderBase as PgColumnBuilder; const column = colBuilder.build(rawTable); rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable)); return [name, column]; @@ -92,7 +93,7 @@ export function pgTableWithSchema< export interface PgTableFn { < TTableName extends string, - TColumnsMap extends Record, + TColumnsMap extends Record, >( name: TTableName, columns: TColumnsMap, diff --git a/drizzle-orm/src/pg-core/unique-constraint.ts b/drizzle-orm/src/pg-core/unique-constraint.ts index 640390da1..339fa604e 100644 --- a/drizzle-orm/src/pg-core/unique-constraint.ts +++ b/drizzle-orm/src/pg-core/unique-constraint.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { PgColumn } from './columns'; -import { PgTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { PgColumn } from './columns/index.ts'; +import { PgTable } from './table.ts'; export function unique(name?: string): UniqueOnConstraintBuilder { return new UniqueOnConstraintBuilder(name); diff --git a/drizzle-orm/src/pg-core/utils.ts b/drizzle-orm/src/pg-core/utils.ts index 0997d3c90..87a72bb0e 100644 --- a/drizzle-orm/src/pg-core/utils.ts +++ b/drizzle-orm/src/pg-core/utils.ts @@ -1,14 +1,14 @@ -import { is } from '~/entity'; -import { PgTable } from '~/pg-core/table'; -import { Table } from '~/table'; -import { ViewBaseConfig } from '~/view'; -import { type Check, CheckBuilder } from './checks'; -import type { AnyPgColumn } from './columns'; -import { type ForeignKey, ForeignKeyBuilder } from './foreign-keys'; -import { type Index, IndexBuilder } from './indexes'; -import { type PrimaryKey, PrimaryKeyBuilder } from './primary-keys'; -import { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint'; -import { type PgMaterializedView, PgMaterializedViewConfig, type PgView, PgViewConfig } from './view'; +import { is } from '~/entity.ts'; +import { PgTable } from '~/pg-core/table.ts'; +import { Table } from '~/table.ts'; +import { ViewBaseConfig } from '~/view.ts'; +import { type Check, CheckBuilder } from './checks.ts'; +import type { AnyPgColumn } from './columns/index.ts'; +import { type ForeignKey, ForeignKeyBuilder } from './foreign-keys.ts'; +import { type Index, IndexBuilder } from './indexes.ts'; +import { type PrimaryKey, PrimaryKeyBuilder } from './primary-keys.ts'; +import { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint.ts'; +import { type PgMaterializedView, PgMaterializedViewConfig, type PgView, PgViewConfig } from './view.ts'; export function getTableConfig(table: TTable) { const columns = Object.values(table[Table.Symbol.Columns]); diff --git a/drizzle-orm/src/pg-core/view.ts b/drizzle-orm/src/pg-core/view.ts index a75f5756c..0ddfcf772 100644 --- a/drizzle-orm/src/pg-core/view.ts +++ b/drizzle-orm/src/pg-core/view.ts @@ -1,15 +1,15 @@ -import type { BuildColumns } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import type { AddAliasToSelection } from '~/query-builders/select.types'; -import type { SQL } from '~/sql'; -import { SelectionProxyHandler } from '~/subquery'; -import { getTableColumns } from '~/utils'; -import { type ColumnsSelection, View } from '~/view'; -import type { PgColumn, PgColumnBuilder } from './columns/common'; -import { QueryBuilder } from './query-builders'; -import type { SelectedFields } from './query-builders/select.types'; -import { pgTable } from './table'; +import type { BuildColumns } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import type { AddAliasToSelection } from '~/query-builders/select.types.ts'; +import type { SQL } from '~/sql/index.ts'; +import { SelectionProxyHandler } from '~/subquery.ts'; +import { getTableColumns } from '~/utils.ts'; +import { type ColumnsSelection, View } from '~/view.ts'; +import type { PgColumn, PgColumnBuilderBase } from './columns/common.ts'; +import { QueryBuilder } from './query-builders/index.ts'; +import type { SelectedFields } from './query-builders/select.types.ts'; +import { pgTable } from './table.ts'; export interface ViewWithConfig { checkOption: 'local' | 'cascaded'; @@ -73,7 +73,7 @@ export class ViewBuilder extends DefaultViewBuild export class ManualViewBuilder< TName extends string = string, - TColumns extends Record = Record, + TColumns extends Record = Record, > extends DefaultViewBuilderCore<{ name: TName; columns: TColumns }> { static readonly [entityKind]: string = 'PgManualViewBuilder'; @@ -214,7 +214,7 @@ export class MaterializedViewBuilder export class ManualMaterializedViewBuilder< TName extends string = string, - TColumns extends Record = Record, + TColumns extends Record = Record, > extends MaterializedViewBuilderCore<{ name: TName; columns: TColumns }> { static readonly [entityKind]: string = 'PgManualMaterializedViewBuilder'; @@ -370,7 +370,7 @@ export type PgMaterializedViewWithSelection< /** @internal */ export function pgViewWithSchema( name: string, - selection: Record | undefined, + selection: Record | undefined, schema: string | undefined, ): ViewBuilder | ManualViewBuilder { if (selection) { @@ -382,7 +382,7 @@ export function pgViewWithSchema( /** @internal */ export function pgMaterializedViewWithSchema( name: string, - selection: Record | undefined, + selection: Record | undefined, schema: string | undefined, ): MaterializedViewBuilder | ManualMaterializedViewBuilder { if (selection) { @@ -392,22 +392,22 @@ export function pgMaterializedViewWithSchema( } export function pgView(name: TName): ViewBuilder; -export function pgView>( +export function pgView>( name: TName, columns: TColumns, ): ManualViewBuilder; -export function pgView(name: string, columns?: Record): ViewBuilder | ManualViewBuilder { +export function pgView(name: string, columns?: Record): ViewBuilder | ManualViewBuilder { return pgViewWithSchema(name, columns, undefined); } export function pgMaterializedView(name: TName): MaterializedViewBuilder; -export function pgMaterializedView>( +export function pgMaterializedView>( name: TName, columns: TColumns, ): ManualMaterializedViewBuilder; export function pgMaterializedView( name: string, - columns?: Record, + columns?: Record, ): MaterializedViewBuilder | ManualMaterializedViewBuilder { return pgMaterializedViewWithSchema(name, columns, undefined); } diff --git a/drizzle-orm/src/planetscale-serverless/driver.ts b/drizzle-orm/src/planetscale-serverless/driver.ts index 591570da2..9f55a2fac 100644 --- a/drizzle-orm/src/planetscale-serverless/driver.ts +++ b/drizzle-orm/src/planetscale-serverless/driver.ts @@ -1,17 +1,17 @@ import type { Connection } from '@planetscale/database'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { MySqlDatabase } from '~/mysql-core/db'; -import { MySqlDialect } from '~/mysql-core/dialect'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { MySqlDatabase } from '~/mysql-core/db.ts'; +import { MySqlDialect } from '~/mysql-core/dialect.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import type { PlanetScalePreparedQueryHKT, PlanetscaleQueryResultHKT } from './session'; -import { PlanetscaleSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import type { PlanetScalePreparedQueryHKT, PlanetscaleQueryResultHKT } from './session.ts'; +import { PlanetscaleSession } from './session.ts'; export interface PlanetscaleSDriverOptions { logger?: Logger; diff --git a/drizzle-orm/src/planetscale-serverless/index.ts b/drizzle-orm/src/planetscale-serverless/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/planetscale-serverless/index.ts +++ b/drizzle-orm/src/planetscale-serverless/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/planetscale-serverless/migrator.ts b/drizzle-orm/src/planetscale-serverless/migrator.ts index 52ba77992..5a668ae01 100644 --- a/drizzle-orm/src/planetscale-serverless/migrator.ts +++ b/drizzle-orm/src/planetscale-serverless/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { PlanetScaleDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { PlanetScaleDatabase } from './driver.ts'; export async function migrate>( db: PlanetScaleDatabase, diff --git a/drizzle-orm/src/planetscale-serverless/session.ts b/drizzle-orm/src/planetscale-serverless/session.ts index 1ca50687c..8652120ff 100644 --- a/drizzle-orm/src/planetscale-serverless/session.ts +++ b/drizzle-orm/src/planetscale-serverless/session.ts @@ -1,9 +1,9 @@ import type { Connection, ExecutedQuery, Transaction } from '@planetscale/database'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import type { MySqlDialect } from '~/mysql-core/dialect'; -import type { SelectedFieldsOrdered } from '~/mysql-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import type { MySqlDialect } from '~/mysql-core/dialect.ts'; +import type { SelectedFieldsOrdered } from '~/mysql-core/query-builders/select.types.ts'; import { MySqlSession, MySqlTransaction, @@ -11,10 +11,10 @@ import { type PreparedQueryConfig, type PreparedQueryHKT, type QueryResultHKT, -} from '~/mysql-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, type SQL, sql } from '~/sql'; -import { type Assume, mapResultRow } from '~/utils'; +} from '~/mysql-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, type SQL, sql } from '~/sql/index.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; export type PlanetScaleConnection = Connection; diff --git a/drizzle-orm/src/postgres-js/driver.ts b/drizzle-orm/src/postgres-js/driver.ts index 5747b4108..bdc2a958d 100644 --- a/drizzle-orm/src/postgres-js/driver.ts +++ b/drizzle-orm/src/postgres-js/driver.ts @@ -1,16 +1,16 @@ import type { Sql } from 'postgres'; -import { DefaultLogger } from '~/logger'; -import { PgDatabase } from '~/pg-core/db'; -import { PgDialect } from '~/pg-core/dialect'; +import { DefaultLogger } from '~/logger.ts'; +import { PgDatabase } from '~/pg-core/db.ts'; +import { PgDialect } from '~/pg-core/dialect.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import type { PostgresJsQueryResultHKT } from './session'; -import { PostgresJsSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import type { PostgresJsQueryResultHKT } from './session.ts'; +import { PostgresJsSession } from './session.ts'; export type PostgresJsDatabase< TSchema extends Record = Record, diff --git a/drizzle-orm/src/postgres-js/index.ts b/drizzle-orm/src/postgres-js/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/postgres-js/index.ts +++ b/drizzle-orm/src/postgres-js/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/postgres-js/migrator.ts b/drizzle-orm/src/postgres-js/migrator.ts index 9fb6b1d73..c57b90ae2 100644 --- a/drizzle-orm/src/postgres-js/migrator.ts +++ b/drizzle-orm/src/postgres-js/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { PostgresJsDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { PostgresJsDatabase } from './driver.ts'; export async function migrate>( db: PostgresJsDatabase, diff --git a/drizzle-orm/src/postgres-js/session.ts b/drizzle-orm/src/postgres-js/session.ts index 163be66fa..8431ca2e0 100644 --- a/drizzle-orm/src/postgres-js/session.ts +++ b/drizzle-orm/src/postgres-js/session.ts @@ -1,16 +1,16 @@ import type { Row, RowList, Sql, TransactionSql } from 'postgres'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { PgTransaction } from '~/pg-core'; -import type { PgDialect } from '~/pg-core/dialect'; -import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session'; -import { PgSession, PreparedQuery } from '~/pg-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query } from '~/sql'; -import { tracer } from '~/tracing'; -import { type Assume, mapResultRow } from '~/utils'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import type { PgDialect } from '~/pg-core/dialect.ts'; +import { PgTransaction } from '~/pg-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session.ts'; +import { PgSession, PreparedQuery } from '~/pg-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query } from '~/sql/index.ts'; +import { tracer } from '~/tracing.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; export class PostgresJsPreparedQuery extends PreparedQuery { static readonly [entityKind]: string = 'PostgresJsPreparedQuery'; diff --git a/drizzle-orm/src/primary-key.ts b/drizzle-orm/src/primary-key.ts index 42def3ae3..78ec818fc 100644 --- a/drizzle-orm/src/primary-key.ts +++ b/drizzle-orm/src/primary-key.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import { type AnyColumn } from './column'; -import { type Table } from './table'; +import { entityKind } from '~/entity.ts'; +import { type AnyColumn } from './column.ts'; +import { type Table } from './table.ts'; export abstract class PrimaryKey { static readonly [entityKind]: string = 'PrimaryKey'; diff --git a/drizzle-orm/src/query-builders/query-builder.ts b/drizzle-orm/src/query-builders/query-builder.ts index 2dc4ea336..c23555aa3 100644 --- a/drizzle-orm/src/query-builders/query-builder.ts +++ b/drizzle-orm/src/query-builders/query-builder.ts @@ -1,5 +1,5 @@ -import { entityKind } from '~/entity'; -import type { SQL, SQLWrapper } from '~/sql'; +import { entityKind } from '~/entity.ts'; +import type { SQL, SQLWrapper } from '~/sql/index.ts'; export abstract class TypedQueryBuilder implements SQLWrapper { static readonly [entityKind]: string = 'TypedQueryBuilder'; diff --git a/drizzle-orm/src/query-builders/select.types.ts b/drizzle-orm/src/query-builders/select.types.ts index 70470a212..8659b0cad 100644 --- a/drizzle-orm/src/query-builders/select.types.ts +++ b/drizzle-orm/src/query-builders/select.types.ts @@ -1,11 +1,11 @@ -import type { AnyColumn, Column, GetColumnData, UpdateColConfig } from '~/column'; -import type { ChangeColumnTableName, Dialect } from '~/column-builder'; -import type { SelectedFields } from '~/operations'; -import type { SQL } from '~/sql'; -import type { Subquery } from '~/subquery'; -import type { AnyTable, Table } from '~/table'; -import type { Assume, DrizzleTypeError, Equal, IsAny, Simplify } from '~/utils'; -import type { ColumnsSelection, View } from '~/view'; +import type { ChangeColumnTableName, Dialect } from '~/column-builder.ts'; +import type { AnyColumn, Column, GetColumnData, UpdateColConfig } from '~/column.ts'; +import type { SelectedFields } from '~/operations.ts'; +import type { SQL } from '~/sql/index.ts'; +import type { Subquery } from '~/subquery.ts'; +import type { AnyTable, Table } from '~/table.ts'; +import type { Assume, DrizzleTypeError, Equal, IsAny, Simplify } from '~/utils.ts'; +import type { ColumnsSelection, View } from '~/view.ts'; export type JoinType = 'inner' | 'left' | 'right' | 'full'; diff --git a/drizzle-orm/src/query-promise.ts b/drizzle-orm/src/query-promise.ts index 5f5e226c1..478813771 100644 --- a/drizzle-orm/src/query-promise.ts +++ b/drizzle-orm/src/query-promise.ts @@ -1,4 +1,4 @@ -import { entityKind } from '~/entity'; +import { entityKind } from '~/entity.ts'; export abstract class QueryPromise implements Promise { static readonly [entityKind]: string = 'QueryPromise'; diff --git a/drizzle-orm/src/relations.ts b/drizzle-orm/src/relations.ts index 7af3112c3..e56a55e81 100644 --- a/drizzle-orm/src/relations.ts +++ b/drizzle-orm/src/relations.ts @@ -1,9 +1,9 @@ -import { type AnyTable, type InferModelFromColumns, isTable, Table } from '~/table'; -import { type AnyColumn, Column } from './column'; -import { entityKind, is } from './entity'; -import { PrimaryKeyBuilder } from './pg-core'; -import { and, asc, desc, eq, or, type Placeholder, SQL, sql } from './sql'; -import { type Assume, type ColumnsWithTable, type Equal, type Simplify, type ValueOrArray } from './utils'; +import { type AnyTable, type InferModelFromColumns, isTable, Table } from '~/table.ts'; +import { type AnyColumn, Column } from './column.ts'; +import { entityKind, is } from './entity.ts'; +import { PrimaryKeyBuilder } from './pg-core/index.ts'; +import { and, asc, desc, eq, or, type Placeholder, SQL, sql } from './sql/index.ts'; +import { type Assume, type ColumnsWithTable, type Equal, type Simplify, type ValueOrArray } from './utils.ts'; export abstract class Relation { static readonly [entityKind]: string = 'Relation'; diff --git a/drizzle-orm/src/sql-js/driver.ts b/drizzle-orm/src/sql-js/driver.ts index b239137aa..b35912c87 100644 --- a/drizzle-orm/src/sql-js/driver.ts +++ b/drizzle-orm/src/sql-js/driver.ts @@ -1,15 +1,15 @@ import type { Database } from 'sql.js'; -import { DefaultLogger } from '~/logger'; +import { DefaultLogger } from '~/logger.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { BaseSQLiteDatabase } from '~/sqlite-core/db'; -import { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import { type DrizzleConfig } from '~/utils'; -import { SQLJsSession } from './session'; +} from '~/relations.ts'; +import { BaseSQLiteDatabase } from '~/sqlite-core/db.ts'; +import { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { SQLJsSession } from './session.ts'; export type SQLJsDatabase< TSchema extends Record = Record, diff --git a/drizzle-orm/src/sql-js/index.ts b/drizzle-orm/src/sql-js/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/sql-js/index.ts +++ b/drizzle-orm/src/sql-js/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/sql-js/migrator.ts b/drizzle-orm/src/sql-js/migrator.ts index 838b0b043..baa7fcea1 100644 --- a/drizzle-orm/src/sql-js/migrator.ts +++ b/drizzle-orm/src/sql-js/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { SQLJsDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { SQLJsDatabase } from './driver.ts'; export function migrate>( db: SQLJsDatabase, diff --git a/drizzle-orm/src/sql-js/session.ts b/drizzle-orm/src/sql-js/session.ts index ad8c0f03e..f9617e40c 100644 --- a/drizzle-orm/src/sql-js/session.ts +++ b/drizzle-orm/src/sql-js/session.ts @@ -1,19 +1,19 @@ import type { BindParams, Database, Statement } from 'sql.js'; -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { SQLiteTransaction } from '~/sqlite-core'; -import type { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import type { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { SQLiteTransaction } from '~/sqlite-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts'; import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig, -} from '~/sqlite-core/session'; -import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session'; -import { mapResultRow } from '~/utils'; +} from '~/sqlite-core/session.ts'; +import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session.ts'; +import { mapResultRow } from '~/utils.ts'; export interface SQLJsSessionOptions { logger?: Logger; diff --git a/drizzle-orm/src/sql/expressions/conditions.ts b/drizzle-orm/src/sql/expressions/conditions.ts index 392fcf44f..fe0e66efd 100644 --- a/drizzle-orm/src/sql/expressions/conditions.ts +++ b/drizzle-orm/src/sql/expressions/conditions.ts @@ -1,7 +1,7 @@ -import { type AnyColumn, Column, type GetColumnData } from '~/column'; -import { is } from '~/entity'; -import { Table } from '~/table'; -import { View } from '~/view'; +import { type AnyColumn, Column, type GetColumnData } from '~/column.ts'; +import { is } from '~/entity.ts'; +import { Table } from '~/table.ts'; +import { View } from '~/view.ts'; import { isDriverValueEncoder, isSQLWrapper, @@ -12,7 +12,7 @@ import { type SQLChunk, type SQLWrapper, StringChunk, -} from '../index'; +} from '../index.ts'; export function bindIfParam(value: unknown, column: SQLWrapper): SQLChunk { if ( diff --git a/drizzle-orm/src/sql/expressions/index.ts b/drizzle-orm/src/sql/expressions/index.ts index 68b98f290..b27ea76f3 100644 --- a/drizzle-orm/src/sql/expressions/index.ts +++ b/drizzle-orm/src/sql/expressions/index.ts @@ -1,2 +1,2 @@ -export * from './conditions'; -export * from './select'; +export * from './conditions.ts'; +export * from './select.ts'; diff --git a/drizzle-orm/src/sql/expressions/select.ts b/drizzle-orm/src/sql/expressions/select.ts index d18439aed..4308454cd 100644 --- a/drizzle-orm/src/sql/expressions/select.ts +++ b/drizzle-orm/src/sql/expressions/select.ts @@ -1,6 +1,6 @@ -import type { AnyColumn } from '../../column'; -import type { SQL, SQLWrapper } from '..'; -import { sql } from '..'; +import type { AnyColumn } from '../../column.ts'; +import type { SQL, SQLWrapper } from '../index.ts'; +import { sql } from '../index.ts'; /** * Used in sorting, this specifies that the given diff --git a/drizzle-orm/src/sql/index.ts b/drizzle-orm/src/sql/index.ts index 2a2fb6a2a..2563ce466 100644 --- a/drizzle-orm/src/sql/index.ts +++ b/drizzle-orm/src/sql/index.ts @@ -1,13 +1,13 @@ -import { entityKind, is } from '~/entity'; -import { Relation } from '~/relations'; -import { Subquery, SubqueryConfig } from '~/subquery'; -import { tracer } from '~/tracing'; -import { View, ViewBaseConfig } from '~/view'; -import type { AnyColumn } from '../column'; -import { Column } from '../column'; -import { Table } from '../table'; - -export * from './expressions'; +import { entityKind, is } from '~/entity.ts'; +import { Relation } from '~/relations.ts'; +import { Subquery, SubqueryConfig } from '~/subquery.ts'; +import { tracer } from '~/tracing.ts'; +import { View, ViewBaseConfig } from '~/view.ts'; +import type { AnyColumn } from '../column.ts'; +import { Column } from '../column.ts'; +import { Table } from '../table.ts'; + +export * from './expressions/index.ts'; /** * This class is used to indicate a primitive param value that is used in `sql` tag. diff --git a/drizzle-orm/src/sqlite-core/alias.ts b/drizzle-orm/src/sqlite-core/alias.ts index 67ffc82b3..4fd9414ce 100644 --- a/drizzle-orm/src/sqlite-core/alias.ts +++ b/drizzle-orm/src/sqlite-core/alias.ts @@ -1,8 +1,8 @@ -import { TableAliasProxyHandler } from '~/alias'; -import { type BuildAliasTable } from './query-builders/select.types'; +import { TableAliasProxyHandler } from '~/alias.ts'; +import { type BuildAliasTable } from './query-builders/select.types.ts'; -import { type SQLiteTable } from './table'; -import { type SQLiteViewBase } from './view'; +import { type SQLiteTable } from './table.ts'; +import { type SQLiteViewBase } from './view.ts'; export function alias( table: TTable, diff --git a/drizzle-orm/src/sqlite-core/checks.ts b/drizzle-orm/src/sqlite-core/checks.ts index 21021ac7a..df992f7c5 100644 --- a/drizzle-orm/src/sqlite-core/checks.ts +++ b/drizzle-orm/src/sqlite-core/checks.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { SQL } from '~/sql'; -import type { SQLiteTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { SQL } from '~/sql/index.ts'; +import type { SQLiteTable } from './table.ts'; export class CheckBuilder { static readonly [entityKind]: string = 'SQLiteCheckBuilder'; diff --git a/drizzle-orm/src/sqlite-core/columns/blob.ts b/drizzle-orm/src/sqlite-core/columns/blob.ts index 915b9fd62..e16ef9021 100644 --- a/drizzle-orm/src/sqlite-core/columns/blob.ts +++ b/drizzle-orm/src/sqlite-core/columns/blob.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnySQLiteTable } from '~/sqlite-core/table'; -import { type Equal } from '~/utils'; -import { SQLiteColumn, SQLiteColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnySQLiteTable } from '~/sqlite-core/table.ts'; +import { type Equal } from '~/utils.ts'; +import { SQLiteColumn, SQLiteColumnBuilder } from './common.ts'; type BlobMode = 'buffer' | 'json' | 'bigint'; diff --git a/drizzle-orm/src/sqlite-core/columns/common.ts b/drizzle-orm/src/sqlite-core/columns/common.ts index cdcd7f3a9..532f272a9 100644 --- a/drizzle-orm/src/sqlite-core/columns/common.ts +++ b/drizzle-orm/src/sqlite-core/columns/common.ts @@ -1,19 +1,20 @@ -import type { ColumnBaseConfig } from '~/column'; -import { Column } from '~/column'; import type { + ColumnBuilderBase, ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnBuilderRuntimeConfig, ColumnDataType, MakeColumnConfig, -} from '~/column-builder'; -import { ColumnBuilder } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { ForeignKey, UpdateDeleteAction } from '~/sqlite-core/foreign-keys'; -import { ForeignKeyBuilder } from '~/sqlite-core/foreign-keys'; -import type { AnySQLiteTable, SQLiteTable } from '~/sqlite-core/table'; -import { type Update } from '~/utils'; -import { uniqueKeyName } from '../unique-constraint'; +} from '~/column-builder.ts'; +import { ColumnBuilder } from '~/column-builder.ts'; +import { Column } from '~/column.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { ForeignKey, UpdateDeleteAction } from '~/sqlite-core/foreign-keys.ts'; +import { ForeignKeyBuilder } from '~/sqlite-core/foreign-keys.ts'; +import type { AnySQLiteTable, SQLiteTable } from '~/sqlite-core/table.ts'; +import { type Update } from '~/utils.ts'; +import { uniqueKeyName } from '../unique-constraint.ts'; export interface ReferenceConfig { ref: () => SQLiteColumn; @@ -23,14 +24,19 @@ export interface ReferenceConfig { }; } +export interface SQLiteColumnBuilderBase< + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, + TTypeConfig extends object = object, +> extends ColumnBuilderBase {} + export abstract class SQLiteColumnBuilder< - T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig & { - data: any; - }, + T extends ColumnBuilderBaseConfig = ColumnBuilderBaseConfig, TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = object, -> extends ColumnBuilder { +> extends ColumnBuilder + implements SQLiteColumnBuilderBase +{ static readonly [entityKind]: string = 'SQLiteColumnBuilder'; private foreignKeyConfigs: ReferenceConfig[] = []; diff --git a/drizzle-orm/src/sqlite-core/columns/custom.ts b/drizzle-orm/src/sqlite-core/columns/custom.ts index 526414a95..7fc1ae47c 100644 --- a/drizzle-orm/src/sqlite-core/columns/custom.ts +++ b/drizzle-orm/src/sqlite-core/columns/custom.ts @@ -1,10 +1,10 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { SQL } from '~/sql'; -import type { AnySQLiteTable } from '~/sqlite-core/table'; -import { type Equal } from '~/utils'; -import { SQLiteColumn, SQLiteColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { SQL } from '~/sql/index.ts'; +import type { AnySQLiteTable } from '~/sqlite-core/table.ts'; +import { type Equal } from '~/utils.ts'; +import { SQLiteColumn, SQLiteColumnBuilder } from './common.ts'; export type ConvertCustomConfig> = & { diff --git a/drizzle-orm/src/sqlite-core/columns/index.ts b/drizzle-orm/src/sqlite-core/columns/index.ts index 8a401601f..1cac45e43 100644 --- a/drizzle-orm/src/sqlite-core/columns/index.ts +++ b/drizzle-orm/src/sqlite-core/columns/index.ts @@ -1,7 +1,7 @@ -export * from './blob'; -export * from './common'; -export * from './custom'; -export * from './integer'; -export * from './numeric'; -export * from './real'; -export * from './text'; +export * from './blob.ts'; +export * from './common.ts'; +export * from './custom.ts'; +export * from './integer.ts'; +export * from './numeric.ts'; +export * from './real.ts'; +export * from './text.ts'; diff --git a/drizzle-orm/src/sqlite-core/columns/integer.ts b/drizzle-orm/src/sqlite-core/columns/integer.ts index 5f2449a9a..957f6fbdb 100644 --- a/drizzle-orm/src/sqlite-core/columns/integer.ts +++ b/drizzle-orm/src/sqlite-core/columns/integer.ts @@ -1,4 +1,3 @@ -import type { ColumnBaseConfig } from '~/column'; import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, @@ -6,13 +5,14 @@ import type { HasDefault, MakeColumnConfig, NotNull, -} from '~/column-builder'; -import { entityKind } from '~/entity'; -import { sql } from '~/sql'; -import type { OnConflict } from '~/sqlite-core/utils'; -import { type Equal, type Or } from '~/utils'; -import type { AnySQLiteTable } from '../table'; -import { SQLiteColumn, SQLiteColumnBuilder } from './common'; +} from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import { sql } from '~/sql/index.ts'; +import type { OnConflict } from '~/sqlite-core/utils.ts'; +import { type Equal, type Or } from '~/utils.ts'; +import type { AnySQLiteTable } from '../table.ts'; +import { SQLiteColumn, SQLiteColumnBuilder } from './common.ts'; export interface PrimaryKeyConfig { autoIncrement?: boolean; diff --git a/drizzle-orm/src/sqlite-core/columns/numeric.ts b/drizzle-orm/src/sqlite-core/columns/numeric.ts index cb7a400de..041e1390c 100644 --- a/drizzle-orm/src/sqlite-core/columns/numeric.ts +++ b/drizzle-orm/src/sqlite-core/columns/numeric.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnySQLiteTable } from '~/sqlite-core/table'; -import { SQLiteColumn, SQLiteColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnySQLiteTable } from '~/sqlite-core/table.ts'; +import { SQLiteColumn, SQLiteColumnBuilder } from './common.ts'; export type SQLiteNumericBuilderInitial = SQLiteNumericBuilder<{ name: TName; diff --git a/drizzle-orm/src/sqlite-core/columns/real.ts b/drizzle-orm/src/sqlite-core/columns/real.ts index 8b813300d..3186d4b8f 100644 --- a/drizzle-orm/src/sqlite-core/columns/real.ts +++ b/drizzle-orm/src/sqlite-core/columns/real.ts @@ -1,8 +1,8 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnySQLiteTable } from '../table'; -import { SQLiteColumn, SQLiteColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnySQLiteTable } from '../table.ts'; +import { SQLiteColumn, SQLiteColumnBuilder } from './common.ts'; export type SQLiteRealBuilderInitial = SQLiteRealBuilder<{ name: TName; diff --git a/drizzle-orm/src/sqlite-core/columns/text.ts b/drizzle-orm/src/sqlite-core/columns/text.ts index 7a7335bb9..2af26708e 100644 --- a/drizzle-orm/src/sqlite-core/columns/text.ts +++ b/drizzle-orm/src/sqlite-core/columns/text.ts @@ -1,9 +1,9 @@ -import type { ColumnBaseConfig } from '~/column'; -import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { AnySQLiteTable } from '~/sqlite-core/table'; -import { type Writable } from '~/utils'; -import { SQLiteColumn, SQLiteColumnBuilder } from './common'; +import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts'; +import type { ColumnBaseConfig } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { AnySQLiteTable } from '~/sqlite-core/table.ts'; +import { type Writable } from '~/utils.ts'; +import { SQLiteColumn, SQLiteColumnBuilder } from './common.ts'; export type SQLiteTextBuilderInitial = SQLiteTextBuilder<{ name: TName; diff --git a/drizzle-orm/src/sqlite-core/db.ts b/drizzle-orm/src/sqlite-core/db.ts index 3a3a431be..57bbfc6eb 100644 --- a/drizzle-orm/src/sqlite-core/db.ts +++ b/drizzle-orm/src/sqlite-core/db.ts @@ -1,23 +1,27 @@ -import { entityKind } from '~/entity'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import { type ExtractTablesWithRelations, type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import type { SQLWrapper } from '~/sql'; -import type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect'; +import { entityKind } from '~/entity.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import { + type ExtractTablesWithRelations, + type RelationalSchemaConfig, + type TablesRelationalConfig, +} from '~/relations.ts'; +import type { SQLWrapper } from '~/sql/index.ts'; +import type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; import { QueryBuilder, SQLiteDelete, SQLiteInsertBuilder, SQLiteSelectBuilder, SQLiteUpdateBuilder, -} from '~/sqlite-core/query-builders'; -import type { Result, SQLiteSession, SQLiteTransaction, SQLiteTransactionConfig } from '~/sqlite-core/session'; -import type { SQLiteTable } from '~/sqlite-core/table'; -import { SelectionProxyHandler, WithSubquery } from '~/subquery'; -import { type DrizzleTypeError } from '~/utils'; -import { type ColumnsSelection } from '~/view'; -import { RelationalQueryBuilder } from './query-builders/query'; -import type { SelectedFields } from './query-builders/select.types'; -import type { WithSubqueryWithSelection } from './subquery'; +} from '~/sqlite-core/query-builders/index.ts'; +import type { Result, SQLiteSession, SQLiteTransaction, SQLiteTransactionConfig } from '~/sqlite-core/session.ts'; +import type { SQLiteTable } from '~/sqlite-core/table.ts'; +import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; +import { type DrizzleTypeError } from '~/utils.ts'; +import { type ColumnsSelection } from '~/view.ts'; +import { RelationalQueryBuilder } from './query-builders/query.ts'; +import type { SelectedFields } from './query-builders/select.types.ts'; +import type { WithSubqueryWithSelection } from './subquery.ts'; export class BaseSQLiteDatabase< TResultKind extends 'sync' | 'async', diff --git a/drizzle-orm/src/sqlite-core/dialect.ts b/drizzle-orm/src/sqlite-core/dialect.ts index e4c83ddc5..4a46f573f 100644 --- a/drizzle-orm/src/sqlite-core/dialect.ts +++ b/drizzle-orm/src/sqlite-core/dialect.ts @@ -1,9 +1,9 @@ -import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from '~/alias'; -import type { AnyColumn } from '~/column'; -import { Column } from '~/column'; -import { entityKind, is } from '~/entity'; -import { DrizzleError } from '~/errors'; -import type { MigrationMeta } from '~/migrator'; +import { aliasedTable, aliasedTableColumn, mapColumnsInAliasedSQLToAlias, mapColumnsInSQLToAlias } from '~/alias.ts'; +import type { AnyColumn } from '~/column.ts'; +import { Column } from '~/column.ts'; +import { entityKind, is } from '~/entity.ts'; +import { DrizzleError } from '~/errors.ts'; +import type { MigrationMeta } from '~/migrator.ts'; import { type BuildRelationalQueryResult, type DBQueryConfig, @@ -15,18 +15,18 @@ import { type Relation, type TableRelationalConfig, type TablesRelationalConfig, -} from '~/relations'; -import { and, eq, Param, type Query, SQL, sql, type SQLChunk } from '~/sql'; -import { SQLiteColumn } from '~/sqlite-core/columns'; -import type { SQLiteDeleteConfig, SQLiteInsertConfig, SQLiteUpdateConfig } from '~/sqlite-core/query-builders'; -import { SQLiteTable } from '~/sqlite-core/table'; -import { Subquery, SubqueryConfig } from '~/subquery'; -import { getTableName, Table } from '~/table'; -import { orderSelectedFields, type UpdateSet } from '~/utils'; -import { ViewBaseConfig } from '~/view'; -import type { Join, SelectedFieldsOrdered, SQLiteSelectConfig } from './query-builders/select.types'; -import type { SQLiteSession } from './session'; -import { SQLiteViewBase } from './view'; +} from '~/relations.ts'; +import { and, eq, Param, type Query, SQL, sql, type SQLChunk } from '~/sql/index.ts'; +import { SQLiteColumn } from '~/sqlite-core/columns/index.ts'; +import type { SQLiteDeleteConfig, SQLiteInsertConfig, SQLiteUpdateConfig } from '~/sqlite-core/query-builders/index.ts'; +import { SQLiteTable } from '~/sqlite-core/table.ts'; +import { Subquery, SubqueryConfig } from '~/subquery.ts'; +import { getTableName, Table } from '~/table.ts'; +import { orderSelectedFields, type UpdateSet } from '~/utils.ts'; +import { ViewBaseConfig } from '~/view.ts'; +import type { Join, SelectedFieldsOrdered, SQLiteSelectConfig } from './query-builders/select.types.ts'; +import type { SQLiteSession } from './session.ts'; +import { SQLiteViewBase } from './view.ts'; export abstract class SQLiteDialect { static readonly [entityKind]: string = 'SQLiteDialect'; diff --git a/drizzle-orm/src/sqlite-core/expressions.ts b/drizzle-orm/src/sqlite-core/expressions.ts index d09a2cff2..5153c2bfa 100644 --- a/drizzle-orm/src/sqlite-core/expressions.ts +++ b/drizzle-orm/src/sqlite-core/expressions.ts @@ -1,9 +1,9 @@ -import { bindIfParam } from '~/expressions'; -import type { SQL, SQLChunk, SQLWrapper } from '~/sql'; -import { sql } from '~/sql'; -import type { SQLiteColumn } from '~/sqlite-core/columns'; +import { bindIfParam } from '~/expressions.ts'; +import type { SQL, SQLChunk, SQLWrapper } from '~/sql/index.ts'; +import { sql } from '~/sql/index.ts'; +import type { SQLiteColumn } from '~/sqlite-core/columns/index.ts'; -export * from '~/expressions'; +export * from '~/expressions.ts'; export function concat(column: SQLiteColumn | SQL.Aliased, value: string | SQLWrapper): SQL { return sql`${column} || ${bindIfParam(value, column)}`; diff --git a/drizzle-orm/src/sqlite-core/foreign-keys.ts b/drizzle-orm/src/sqlite-core/foreign-keys.ts index 9d13aab8a..1aab5c765 100644 --- a/drizzle-orm/src/sqlite-core/foreign-keys.ts +++ b/drizzle-orm/src/sqlite-core/foreign-keys.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { AnySQLiteColumn, SQLiteColumn } from './columns'; -import { SQLiteTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { AnySQLiteColumn, SQLiteColumn } from './columns/index.ts'; +import { SQLiteTable } from './table.ts'; export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default'; diff --git a/drizzle-orm/src/sqlite-core/index.ts b/drizzle-orm/src/sqlite-core/index.ts index e52b8759e..ac2a19f0a 100644 --- a/drizzle-orm/src/sqlite-core/index.ts +++ b/drizzle-orm/src/sqlite-core/index.ts @@ -1,15 +1,15 @@ -export * from './alias'; -export * from './checks'; -export * from './columns'; -export * from './db'; -export * from './dialect'; -export * from './foreign-keys'; -export * from './indexes'; -export * from './primary-keys'; -export * from './query-builders'; -export * from './session'; -export * from './subquery'; -export * from './table'; -export * from './unique-constraint'; -export * from './utils'; -export * from './view'; +export * from './alias.ts'; +export * from './checks.ts'; +export * from './columns/index.ts'; +export * from './db.ts'; +export * from './dialect.ts'; +export * from './foreign-keys.ts'; +export * from './indexes.ts'; +export * from './primary-keys.ts'; +export * from './query-builders/index.ts'; +export * from './session.ts'; +export * from './subquery.ts'; +export * from './table.ts'; +export * from './unique-constraint.ts'; +export * from './utils.ts'; +export * from './view.ts'; diff --git a/drizzle-orm/src/sqlite-core/indexes.ts b/drizzle-orm/src/sqlite-core/indexes.ts index 9f30ec106..d3efb8cde 100644 --- a/drizzle-orm/src/sqlite-core/indexes.ts +++ b/drizzle-orm/src/sqlite-core/indexes.ts @@ -1,7 +1,7 @@ -import { entityKind } from '~/entity'; -import type { SQL } from '~/sql'; -import { type SQLiteColumn } from './columns'; -import type { SQLiteTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { SQL } from '~/sql/index.ts'; +import { type SQLiteColumn } from './columns/index.ts'; +import type { SQLiteTable } from './table.ts'; export interface IndexConfig { name: string; diff --git a/drizzle-orm/src/sqlite-core/primary-keys.ts b/drizzle-orm/src/sqlite-core/primary-keys.ts index 0f9c0e1b9..5285eacbd 100644 --- a/drizzle-orm/src/sqlite-core/primary-keys.ts +++ b/drizzle-orm/src/sqlite-core/primary-keys.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import type { AnySQLiteColumn, SQLiteColumn } from './columns'; -import { SQLiteTable } from './table'; +import { entityKind } from '~/entity.ts'; +import type { AnySQLiteColumn, SQLiteColumn } from './columns/index.ts'; +import { SQLiteTable } from './table.ts'; export function primaryKey< TTableName extends string, diff --git a/drizzle-orm/src/sqlite-core/query-builders/delete.ts b/drizzle-orm/src/sqlite-core/query-builders/delete.ts index 031bdaeba..f95833d1d 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/delete.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/delete.ts @@ -1,13 +1,13 @@ -import { entityKind } from '~/entity'; -import type { SelectResultFields } from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL, SQLWrapper } from '~/sql'; -import type { SQLiteDialect } from '~/sqlite-core/dialect'; -import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session'; -import { SQLiteTable } from '~/sqlite-core/table'; -import type { InferModel } from '~/table'; -import { type DrizzleTypeError, orderSelectedFields } from '~/utils'; -import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types'; +import { entityKind } from '~/entity.ts'; +import type { SelectResultFields } from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL, SQLWrapper } from '~/sql/index.ts'; +import type { SQLiteDialect } from '~/sqlite-core/dialect.ts'; +import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts'; +import { SQLiteTable } from '~/sqlite-core/table.ts'; +import type { InferModel } from '~/table.ts'; +import { type DrizzleTypeError, orderSelectedFields } from '~/utils.ts'; +import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types.ts'; export interface SQLiteDeleteConfig { where?: SQL | undefined; diff --git a/drizzle-orm/src/sqlite-core/query-builders/index.ts b/drizzle-orm/src/sqlite-core/query-builders/index.ts index 8da6da017..16f0e1d4d 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/index.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/index.ts @@ -1,6 +1,6 @@ -export * from './delete'; -export * from './insert'; -export * from './query-builder'; -export * from './select'; -export * from './select.types'; -export * from './update'; +export * from './delete.ts'; +export * from './insert.ts'; +export * from './query-builder.ts'; +export * from './select.ts'; +export * from './select.types.ts'; +export * from './update.ts'; diff --git a/drizzle-orm/src/sqlite-core/query-builders/insert.ts b/drizzle-orm/src/sqlite-core/query-builders/insert.ts index 703bca65d..a4b177ee7 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/insert.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/insert.ts @@ -1,16 +1,16 @@ -import { entityKind, is } from '~/entity'; -import type { SelectResultFields } from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { Placeholder, Query, SQLWrapper } from '~/sql'; -import { Param, SQL, sql } from '~/sql'; -import type { SQLiteDialect } from '~/sqlite-core/dialect'; -import type { IndexColumn } from '~/sqlite-core/indexes'; -import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session'; -import { SQLiteTable } from '~/sqlite-core/table'; -import { type InferModel, Table } from '~/table'; -import { type DrizzleTypeError, mapUpdateSet, orderSelectedFields, type Simplify } from '~/utils'; -import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types'; -import type { SQLiteUpdateSetSource } from './update'; +import { entityKind, is } from '~/entity.ts'; +import type { SelectResultFields } from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Placeholder, Query, SQLWrapper } from '~/sql/index.ts'; +import { Param, SQL, sql } from '~/sql/index.ts'; +import type { SQLiteDialect } from '~/sqlite-core/dialect.ts'; +import type { IndexColumn } from '~/sqlite-core/indexes.ts'; +import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts'; +import { SQLiteTable } from '~/sqlite-core/table.ts'; +import { type InferModel, Table } from '~/table.ts'; +import { type DrizzleTypeError, mapUpdateSet, orderSelectedFields, type Simplify } from '~/utils.ts'; +import type { SelectedFieldsFlat, SelectedFieldsOrdered } from './select.types.ts'; +import type { SQLiteUpdateSetSource } from './update.ts'; export interface SQLiteInsertConfig { table: TTable; diff --git a/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts b/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts index 72024343d..06d553c15 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts @@ -1,11 +1,11 @@ -import { entityKind } from '~/entity'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import { SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import type { WithSubqueryWithSelection } from '~/sqlite-core/subquery'; -import { SelectionProxyHandler, WithSubquery } from '~/subquery'; -import { type ColumnsSelection } from '~/view'; -import { SQLiteSelectBuilder } from './select'; -import type { SelectedFields } from './select.types'; +import { entityKind } from '~/entity.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import type { WithSubqueryWithSelection } from '~/sqlite-core/subquery.ts'; +import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; +import { type ColumnsSelection } from '~/view.ts'; +import { SQLiteSelectBuilder } from './select.ts'; +import type { SelectedFields } from './select.types.ts'; export class QueryBuilder { static readonly [entityKind]: string = 'SQLiteQueryBuilder'; diff --git a/drizzle-orm/src/sqlite-core/query-builders/query.ts b/drizzle-orm/src/sqlite-core/query-builders/query.ts index 563a42082..c41e770b7 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/query.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/query.ts @@ -1,17 +1,17 @@ -import { entityKind } from '~/entity'; -import { QueryPromise } from '~/query-promise'; +import { entityKind } from '~/entity.ts'; +import { QueryPromise } from '~/query-promise.ts'; import { type BuildQueryResult, type DBQueryConfig, mapRelationalRow, type TableRelationalConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type SQL } from '~/sql'; -import { type KnownKeysOnly } from '~/utils'; -import { type SQLiteDialect } from '../dialect'; -import { type PreparedQuery, type PreparedQueryConfig, type SQLiteSession } from '../session'; -import { type SQLiteTable } from '../table'; +} from '~/relations.ts'; +import { type SQL } from '~/sql/index.ts'; +import { type KnownKeysOnly } from '~/utils.ts'; +import { type SQLiteDialect } from '../dialect.ts'; +import { type PreparedQuery, type PreparedQueryConfig, type SQLiteSession } from '../session.ts'; +import { type SQLiteTable } from '../table.ts'; export type SQLiteRelationalQueryKind = TMode extends 'async' ? SQLiteRelationalQuery diff --git a/drizzle-orm/src/sqlite-core/query-builders/select.ts b/drizzle-orm/src/sqlite-core/query-builders/select.ts index 3f42b57ad..684d7965c 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/select.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/select.ts @@ -1,12 +1,12 @@ -import { entityKind, is } from '~/entity'; -import { type Placeholder, type Query, SQL } from '~/sql'; -import type { SQLiteColumn } from '~/sqlite-core/columns'; -import type { SQLiteDialect } from '~/sqlite-core/dialect'; -import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session'; -import type { SQLiteTable } from '~/sqlite-core/table'; -import { Table } from '~/table'; - -import { TypedQueryBuilder } from '~/query-builders/query-builder'; +import { entityKind, is } from '~/entity.ts'; +import { type Placeholder, type Query, SQL } from '~/sql/index.ts'; +import type { SQLiteColumn } from '~/sqlite-core/columns/index.ts'; +import type { SQLiteDialect } from '~/sqlite-core/dialect.ts'; +import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts'; +import type { SQLiteTable } from '~/sqlite-core/table.ts'; +import { Table } from '~/table.ts'; + +import { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; import type { BuildSubquerySelection, GetSelectTableName, @@ -15,10 +15,10 @@ import type { JoinType, SelectMode, SelectResult, -} from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { SubqueryWithSelection } from '~/sqlite-core/subquery'; -import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery'; +} from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { SubqueryWithSelection } from '~/sqlite-core/subquery.ts'; +import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery.ts'; import { applyMixins, getTableColumns, @@ -26,9 +26,9 @@ import { orderSelectedFields, type PromiseOf, type ValueOrArray, -} from '~/utils'; -import { type ColumnsSelection, View, ViewBaseConfig } from '~/view'; -import { SQLiteViewBase } from '../view'; +} from '~/utils.ts'; +import { type ColumnsSelection, View, ViewBaseConfig } from '~/view.ts'; +import { SQLiteViewBase } from '../view.ts'; import type { JoinFn, SelectedFields, @@ -36,7 +36,7 @@ import type { SQLiteSelectHKT, SQLiteSelectHKTBase, SQLiteSelectQueryBuilderHKT, -} from './select.types'; +} from './select.types.ts'; type CreateSQLiteSelectFromBuilderMode< TBuilderMode extends 'db' | 'qb', diff --git a/drizzle-orm/src/sqlite-core/query-builders/select.types.ts b/drizzle-orm/src/sqlite-core/query-builders/select.types.ts index 72d508367..9ad5ff436 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/select.types.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/select.types.ts @@ -1,14 +1,14 @@ -import type { Placeholder, SQL } from '~/sql'; -import type { Assume } from '~/utils'; +import type { Placeholder, SQL } from '~/sql/index.ts'; +import type { Assume } from '~/utils.ts'; -import type { SQLiteColumn } from '~/sqlite-core/columns'; -import type { SQLiteTable, SQLiteTableWithColumns } from '~/sqlite-core/table'; +import type { SQLiteColumn } from '~/sqlite-core/columns/index.ts'; +import type { SQLiteTable, SQLiteTableWithColumns } from '~/sqlite-core/table.ts'; import type { SelectedFields as SelectFieldsBase, SelectedFieldsFlat as SelectFieldsFlatBase, SelectedFieldsOrdered as SelectFieldsOrderedBase, -} from '~/operations'; +} from '~/operations.ts'; import type { AppendToNullabilityMap, AppendToResult, @@ -17,12 +17,12 @@ import type { JoinType, MapColumnsToTableAlias, SelectMode, -} from '~/query-builders/select.types'; -import type { Subquery } from '~/subquery'; -import type { Table, UpdateTableConfig } from '~/table'; -import { type ColumnsSelection, type View } from '~/view'; -import type { SQLiteViewBase, SQLiteViewWithSelection } from '../view'; -import type { SQLiteSelect, SQLiteSelectQueryBuilder } from './select'; +} from '~/query-builders/select.types.ts'; +import type { Subquery } from '~/subquery.ts'; +import type { Table, UpdateTableConfig } from '~/table.ts'; +import { type ColumnsSelection, type View } from '~/view.ts'; +import type { SQLiteViewBase, SQLiteViewWithSelection } from '../view.ts'; +import type { SQLiteSelect, SQLiteSelectQueryBuilder } from './select.ts'; export interface Join { on: SQL | undefined; diff --git a/drizzle-orm/src/sqlite-core/query-builders/update.ts b/drizzle-orm/src/sqlite-core/query-builders/update.ts index 88ad31a2f..5d130f4f8 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/update.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/update.ts @@ -1,14 +1,14 @@ -import type { GetColumnData } from '~/column'; -import { entityKind } from '~/entity'; -import type { SelectResultFields } from '~/query-builders/select.types'; -import { QueryPromise } from '~/query-promise'; -import type { Query, SQL, SQLWrapper } from '~/sql'; -import type { SQLiteDialect } from '~/sqlite-core/dialect'; -import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session'; -import { SQLiteTable } from '~/sqlite-core/table'; -import type { InferModel } from '~/table'; -import { type DrizzleTypeError, mapUpdateSet, orderSelectedFields, type UpdateSet } from '~/utils'; -import type { SelectedFields, SelectedFieldsOrdered } from './select.types'; +import type { GetColumnData } from '~/column.ts'; +import { entityKind } from '~/entity.ts'; +import type { SelectResultFields } from '~/query-builders/select.types.ts'; +import { QueryPromise } from '~/query-promise.ts'; +import type { Query, SQL, SQLWrapper } from '~/sql/index.ts'; +import type { SQLiteDialect } from '~/sqlite-core/dialect.ts'; +import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts'; +import { SQLiteTable } from '~/sqlite-core/table.ts'; +import type { InferModel } from '~/table.ts'; +import { type DrizzleTypeError, mapUpdateSet, orderSelectedFields, type UpdateSet } from '~/utils.ts'; +import type { SelectedFields, SelectedFieldsOrdered } from './select.types.ts'; export interface SQLiteUpdateConfig { where?: SQL | undefined; diff --git a/drizzle-orm/src/sqlite-core/session.ts b/drizzle-orm/src/sqlite-core/session.ts index cf3522083..5f162ec50 100644 --- a/drizzle-orm/src/sqlite-core/session.ts +++ b/drizzle-orm/src/sqlite-core/session.ts @@ -1,11 +1,11 @@ -import { entityKind } from '~/entity'; -import { DrizzleError, TransactionRollbackError } from '~/errors'; -import { type TablesRelationalConfig } from '~/relations'; -import type { Query, SQL } from '~/sql'; -import type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect'; -import { QueryPromise } from '..'; -import { BaseSQLiteDatabase } from './db'; -import type { SelectedFieldsOrdered } from './query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import { DrizzleError, TransactionRollbackError } from '~/errors.ts'; +import { type TablesRelationalConfig } from '~/relations.ts'; +import type { Query, SQL } from '~/sql/index.ts'; +import type { SQLiteAsyncDialect, SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; +import { QueryPromise } from '../index.ts'; +import { BaseSQLiteDatabase } from './db.ts'; +import type { SelectedFieldsOrdered } from './query-builders/select.types.ts'; export interface PreparedQueryConfig { type: 'sync' | 'async'; diff --git a/drizzle-orm/src/sqlite-core/subquery.ts b/drizzle-orm/src/sqlite-core/subquery.ts index 8ef733831..626241594 100644 --- a/drizzle-orm/src/sqlite-core/subquery.ts +++ b/drizzle-orm/src/sqlite-core/subquery.ts @@ -1,6 +1,6 @@ -import type { AddAliasToSelection } from '~/query-builders/select.types'; -import type { Subquery, WithSubquery } from '~/subquery'; -import { type ColumnsSelection } from '~/view'; +import type { AddAliasToSelection } from '~/query-builders/select.types.ts'; +import type { Subquery, WithSubquery } from '~/subquery.ts'; +import { type ColumnsSelection } from '~/view.ts'; export type SubqueryWithSelection = & Subquery> diff --git a/drizzle-orm/src/sqlite-core/table.ts b/drizzle-orm/src/sqlite-core/table.ts index 9c7273ca9..c762c0c5c 100644 --- a/drizzle-orm/src/sqlite-core/table.ts +++ b/drizzle-orm/src/sqlite-core/table.ts @@ -1,12 +1,12 @@ -import type { BuildColumns } from '~/column-builder'; -import { entityKind } from '~/entity'; -import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table'; -import type { CheckBuilder } from './checks'; -import type { SQLiteColumn, SQLiteColumnBuilder } from './columns/common'; -import type { ForeignKey, ForeignKeyBuilder } from './foreign-keys'; -import type { IndexBuilder } from './indexes'; -import type { PrimaryKeyBuilder } from './primary-keys'; -import type { UniqueConstraintBuilder } from './unique-constraint'; +import type { BuildColumns } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import { Table, type TableConfig as TableConfigBase, type UpdateTableConfig } from '~/table.ts'; +import type { CheckBuilder } from './checks.ts'; +import type { SQLiteColumn, SQLiteColumnBuilder, SQLiteColumnBuilderBase } from './columns/common.ts'; +import type { ForeignKey, ForeignKeyBuilder } from './foreign-keys.ts'; +import type { IndexBuilder } from './indexes.ts'; +import type { PrimaryKeyBuilder } from './primary-keys.ts'; +import type { UniqueConstraintBuilder } from './unique-constraint.ts'; export type SQLiteTableExtraConfig = Record< string, @@ -55,7 +55,7 @@ export type SQLiteTableWithColumns = export interface SQLiteTableFn { < TTableName extends string, - TColumnsMap extends Record, + TColumnsMap extends Record, >( name: TTableName, columns: TColumnsMap, @@ -70,7 +70,7 @@ export interface SQLiteTableFn { function sqliteTableBase< TTableName extends string, - TColumnsMap extends Record, + TColumnsMap extends Record, TSchema extends string | undefined, >( name: TTableName, @@ -92,7 +92,8 @@ function sqliteTableBase< }>(name, schema, baseName); const builtColumns = Object.fromEntries( - Object.entries(columns).map(([name, colBuilder]) => { + Object.entries(columns).map(([name, colBuilderBase]) => { + const colBuilder = colBuilderBase as SQLiteColumnBuilder; const column = colBuilder.build(rawTable); rawTable[InlineForeignKeys].push(...colBuilder.buildForeignKeys(column, rawTable)); return [name, column]; diff --git a/drizzle-orm/src/sqlite-core/unique-constraint.ts b/drizzle-orm/src/sqlite-core/unique-constraint.ts index dbbc18024..136280d79 100644 --- a/drizzle-orm/src/sqlite-core/unique-constraint.ts +++ b/drizzle-orm/src/sqlite-core/unique-constraint.ts @@ -1,6 +1,6 @@ -import { entityKind } from '~/entity'; -import { type SQLiteColumn } from './columns'; -import { SQLiteTable } from './table'; +import { entityKind } from '~/entity.ts'; +import { type SQLiteColumn } from './columns/index.ts'; +import { SQLiteTable } from './table.ts'; export function uniqueKeyName(table: SQLiteTable, columns: string[]) { return `${table[SQLiteTable.Symbol.Name]}_${columns.join('_')}_unique`; diff --git a/drizzle-orm/src/sqlite-core/utils.ts b/drizzle-orm/src/sqlite-core/utils.ts index 8756a4443..0d06dc8ef 100644 --- a/drizzle-orm/src/sqlite-core/utils.ts +++ b/drizzle-orm/src/sqlite-core/utils.ts @@ -1,17 +1,17 @@ -import { is } from '~/entity'; -import { Table } from '~/table'; -import { ViewBaseConfig } from '~/view'; -import type { Check } from './checks'; -import { CheckBuilder } from './checks'; -import type { ForeignKey } from './foreign-keys'; -import { ForeignKeyBuilder } from './foreign-keys'; -import type { Index } from './indexes'; -import { IndexBuilder } from './indexes'; -import type { PrimaryKey } from './primary-keys'; -import { PrimaryKeyBuilder } from './primary-keys'; -import { SQLiteTable } from './table'; -import { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint'; -import { type SQLiteView, SQLiteViewConfig } from './view'; +import { is } from '~/entity.ts'; +import { Table } from '~/table.ts'; +import { ViewBaseConfig } from '~/view.ts'; +import type { Check } from './checks.ts'; +import { CheckBuilder } from './checks.ts'; +import type { ForeignKey } from './foreign-keys.ts'; +import { ForeignKeyBuilder } from './foreign-keys.ts'; +import type { Index } from './indexes.ts'; +import { IndexBuilder } from './indexes.ts'; +import type { PrimaryKey } from './primary-keys.ts'; +import { PrimaryKeyBuilder } from './primary-keys.ts'; +import { SQLiteTable } from './table.ts'; +import { type UniqueConstraint, UniqueConstraintBuilder } from './unique-constraint.ts'; +import { type SQLiteView, SQLiteViewConfig } from './view.ts'; export function getTableConfig(table: TTable) { const columns = Object.values(table[SQLiteTable.Symbol.Columns]); diff --git a/drizzle-orm/src/sqlite-core/view.ts b/drizzle-orm/src/sqlite-core/view.ts index 7fd67dc82..8b040ba9e 100644 --- a/drizzle-orm/src/sqlite-core/view.ts +++ b/drizzle-orm/src/sqlite-core/view.ts @@ -1,15 +1,15 @@ -import type { BuildColumns } from '~/column-builder'; -import { entityKind } from '~/entity'; -import type { TypedQueryBuilder } from '~/query-builders/query-builder'; -import type { AddAliasToSelection } from '~/query-builders/select.types'; -import type { SQL } from '~/sql'; -import { SelectionProxyHandler } from '~/subquery'; -import { getTableColumns } from '~/utils'; -import { type ColumnsSelection, View } from '~/view'; -import type { SQLiteColumn, SQLiteColumnBuilder } from './columns/common'; -import { QueryBuilder } from './query-builders'; -import type { SelectedFields } from './query-builders/select.types'; -import { sqliteTable } from './table'; +import type { BuildColumns } from '~/column-builder.ts'; +import { entityKind } from '~/entity.ts'; +import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; +import type { AddAliasToSelection } from '~/query-builders/select.types.ts'; +import type { SQL } from '~/sql/index.ts'; +import { SelectionProxyHandler } from '~/subquery.ts'; +import { getTableColumns } from '~/utils.ts'; +import { type ColumnsSelection, View } from '~/view.ts'; +import type { SQLiteColumn, SQLiteColumnBuilderBase } from './columns/common.ts'; +import { QueryBuilder } from './query-builders/index.ts'; +import type { SelectedFields } from './query-builders/select.types.ts'; +import { sqliteTable } from './table.ts'; export interface ViewBuilderConfig { algorithm?: 'undefined' | 'merge' | 'temptable'; @@ -69,7 +69,7 @@ export class ViewBuilder extends ViewBuilderCore< export class ManualViewBuilder< TName extends string = string, - TColumns extends Record = Record, + TColumns extends Record = Record, > extends ViewBuilderCore< { name: TName; columns: TColumns } > { @@ -171,13 +171,13 @@ export type SQLiteViewWithSelection< > = SQLiteView & TSelection; export function sqliteView(name: TName): ViewBuilder; -export function sqliteView>( +export function sqliteView>( name: TName, columns: TColumns, ): ManualViewBuilder; export function sqliteView( name: string, - selection?: Record, + selection?: Record, ): ViewBuilder | ManualViewBuilder { if (selection) { return new ManualViewBuilder(name, selection); diff --git a/drizzle-orm/src/sqlite-proxy/driver.ts b/drizzle-orm/src/sqlite-proxy/driver.ts index 0610d3243..1d2a33cd9 100644 --- a/drizzle-orm/src/sqlite-proxy/driver.ts +++ b/drizzle-orm/src/sqlite-proxy/driver.ts @@ -1,14 +1,14 @@ -import { DefaultLogger } from '~/logger'; +import { DefaultLogger } from '~/logger.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { BaseSQLiteDatabase } from '~/sqlite-core/db'; -import { SQLiteAsyncDialect } from '~/sqlite-core/dialect'; -import { type DrizzleConfig } from '~/utils'; -import { SQLiteRemoteSession } from './session'; +} from '~/relations.ts'; +import { BaseSQLiteDatabase } from '~/sqlite-core/db.ts'; +import { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { SQLiteRemoteSession } from './session.ts'; export interface SqliteRemoteResult { rows?: T[]; diff --git a/drizzle-orm/src/sqlite-proxy/index.ts b/drizzle-orm/src/sqlite-proxy/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/sqlite-proxy/index.ts +++ b/drizzle-orm/src/sqlite-proxy/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/sqlite-proxy/migrator.ts b/drizzle-orm/src/sqlite-proxy/migrator.ts index df2981a45..c5822a8c8 100644 --- a/drizzle-orm/src/sqlite-proxy/migrator.ts +++ b/drizzle-orm/src/sqlite-proxy/migrator.ts @@ -1,7 +1,7 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import { sql } from '~/sql'; -import type { SqliteRemoteDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import { sql } from '~/sql/index.ts'; +import type { SqliteRemoteDatabase } from './driver.ts'; export type ProxyMigrator = (migrationQueries: string[]) => Promise; diff --git a/drizzle-orm/src/sqlite-proxy/session.ts b/drizzle-orm/src/sqlite-proxy/session.ts index bb488ca83..e9b09990b 100644 --- a/drizzle-orm/src/sqlite-proxy/session.ts +++ b/drizzle-orm/src/sqlite-proxy/session.ts @@ -1,19 +1,19 @@ -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { NoopLogger } from '~/logger'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { SQLiteTransaction } from '~/sqlite-core'; -import type { SQLiteAsyncDialect } from '~/sqlite-core/dialect'; -import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { NoopLogger } from '~/logger.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import type { SQLiteAsyncDialect } from '~/sqlite-core/dialect.ts'; +import { SQLiteTransaction } from '~/sqlite-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/sqlite-core/query-builders/select.types.ts'; import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig, -} from '~/sqlite-core/session'; -import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session'; -import { mapResultRow } from '~/utils'; -import { type RemoteCallback, type SqliteRemoteResult } from './driver'; +} from '~/sqlite-core/session.ts'; +import { PreparedQuery as PreparedQueryBase, SQLiteSession } from '~/sqlite-core/session.ts'; +import { mapResultRow } from '~/utils.ts'; +import { type RemoteCallback, type SqliteRemoteResult } from './driver.ts'; export interface SQLiteRemoteSessionOptions { logger?: Logger; diff --git a/drizzle-orm/src/subquery.ts b/drizzle-orm/src/subquery.ts index 69ee2c77e..094a075be 100644 --- a/drizzle-orm/src/subquery.ts +++ b/drizzle-orm/src/subquery.ts @@ -1,8 +1,8 @@ -import { ColumnAliasProxyHandler, TableAliasProxyHandler } from './alias'; -import { Column } from './column'; -import { entityKind, is } from './entity'; -import { SQL, type SQLWrapper } from './sql'; -import { type ColumnsSelection, View, ViewBaseConfig } from './view'; +import { ColumnAliasProxyHandler, TableAliasProxyHandler } from './alias.ts'; +import { Column } from './column.ts'; +import { entityKind, is } from './entity.ts'; +import { SQL, type SQLWrapper } from './sql/index.ts'; +import { type ColumnsSelection, View, ViewBaseConfig } from './view.ts'; export const SubqueryConfig = Symbol.for('drizzle:SubqueryConfig'); diff --git a/drizzle-orm/src/table.ts b/drizzle-orm/src/table.ts index 6919ee82a..a6e6f0fc7 100644 --- a/drizzle-orm/src/table.ts +++ b/drizzle-orm/src/table.ts @@ -1,8 +1,8 @@ -import type { Column, GetColumnData } from './column'; -import { entityKind } from './entity'; -import type { OptionalKeyOnly, RequiredKeyOnly } from './operations'; -import { SQL, type SQLWrapper } from './sql'; -import { type Simplify, type Update } from './utils'; +import type { Column, GetColumnData } from './column.ts'; +import { entityKind } from './entity.ts'; +import type { OptionalKeyOnly, RequiredKeyOnly } from './operations.ts'; +import { SQL, type SQLWrapper } from './sql/index.ts'; +import { type Simplify, type Update } from './utils.ts'; export interface TableConfig> { name: string; @@ -126,33 +126,34 @@ export type InferModelFromColumns< TColumns extends Record, TInferMode extends 'select' | 'insert' = 'select', TConfig extends { dbColumnNames: boolean } = { dbColumnNames: false }, -> = TInferMode extends 'insert' ? Simplify< - & { +> = Simplify< + TInferMode extends 'insert' ? + & { + [ + Key in keyof TColumns & string as RequiredKeyOnly< + MapColumnName, + TColumns[Key] + > + ]: GetColumnData; + } + & { + [ + Key in keyof TColumns & string as OptionalKeyOnly< + MapColumnName, + TColumns[Key] + > + ]?: GetColumnData; + } + : { [ - Key in keyof TColumns & string as RequiredKeyOnly< - MapColumnName, - TColumns[Key] + Key in keyof TColumns & string as MapColumnName< + Key, + TColumns[Key], + TConfig['dbColumnNames'] > ]: GetColumnData; } - & { - [ - Key in keyof TColumns & string as OptionalKeyOnly< - MapColumnName, - TColumns[Key] - > - ]?: GetColumnData; - } - > - : { - [ - Key in keyof TColumns & string as MapColumnName< - Key, - TColumns[Key], - TConfig['dbColumnNames'] - > - ]: GetColumnData; - }; +>; /** @deprecated Use one of the alternatives: {@link InferSelectModel} / {@link InferInsertModel}, or `table._.inferSelect` / `table._.inferInsert` */ diff --git a/drizzle-orm/src/tracing.ts b/drizzle-orm/src/tracing.ts index bc2acb7cb..906a67a72 100644 --- a/drizzle-orm/src/tracing.ts +++ b/drizzle-orm/src/tracing.ts @@ -1,6 +1,6 @@ import { type Span, type Tracer } from '@opentelemetry/api'; -import { iife } from '~/utils'; -import { npmVersion } from '~/version'; +import { iife } from '~/utils.ts'; +import { npmVersion } from '~/version.ts'; let otel: typeof import('@opentelemetry/api') | undefined; let rawTracer: Tracer | undefined; diff --git a/drizzle-orm/src/utils.ts b/drizzle-orm/src/utils.ts index a27c5e3ab..dc71112eb 100644 --- a/drizzle-orm/src/utils.ts +++ b/drizzle-orm/src/utils.ts @@ -1,14 +1,14 @@ -import type { AnyColumn } from './column'; -import { Column } from './column'; -import { is } from './entity'; -import { type Logger } from './logger'; -import type { SelectedFieldsOrdered } from './operations'; -import { type TableLike } from './query-builders/select.types'; -import type { DriverValueDecoder } from './sql'; -import { Param, SQL } from './sql'; -import { Subquery, SubqueryConfig } from './subquery'; -import { getTableName, Table } from './table'; -import { View, ViewBaseConfig } from './view'; +import type { AnyColumn } from './column.ts'; +import { Column } from './column.ts'; +import { is } from './entity.ts'; +import { type Logger } from './logger.ts'; +import type { SelectedFieldsOrdered } from './operations.ts'; +import { type TableLike } from './query-builders/select.types.ts'; +import { Param, SQL } from './sql/index.ts'; +import type { DriverValueDecoder } from './sql/index.ts'; +import { Subquery, SubqueryConfig } from './subquery.ts'; +import { getTableName, Table } from './table.ts'; +import { View, ViewBaseConfig } from './view.ts'; /** @internal */ export function mapResultRow( diff --git a/drizzle-orm/src/vercel-postgres/driver.ts b/drizzle-orm/src/vercel-postgres/driver.ts index dbea2f710..91fd5c3a2 100644 --- a/drizzle-orm/src/vercel-postgres/driver.ts +++ b/drizzle-orm/src/vercel-postgres/driver.ts @@ -1,16 +1,16 @@ -import { entityKind } from '~/entity'; -import type { Logger } from '~/logger'; -import { DefaultLogger } from '~/logger'; -import { PgDialect } from '~/pg-core'; -import { PgDatabase } from '~/pg-core/db'; +import { entityKind } from '~/entity.ts'; +import type { Logger } from '~/logger.ts'; +import { DefaultLogger } from '~/logger.ts'; +import { PgDatabase } from '~/pg-core/db.ts'; +import { PgDialect } from '~/pg-core/index.ts'; import { createTableRelationsHelpers, extractTablesRelationalConfig, type RelationalSchemaConfig, type TablesRelationalConfig, -} from '~/relations'; -import { type DrizzleConfig } from '~/utils'; -import { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from './session'; +} from '~/relations.ts'; +import { type DrizzleConfig } from '~/utils.ts'; +import { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from './session.ts'; export interface VercelPgDriverOptions { logger?: Logger; diff --git a/drizzle-orm/src/vercel-postgres/index.ts b/drizzle-orm/src/vercel-postgres/index.ts index 134c88e01..b1b6a52e7 100644 --- a/drizzle-orm/src/vercel-postgres/index.ts +++ b/drizzle-orm/src/vercel-postgres/index.ts @@ -1,2 +1,2 @@ -export * from './driver'; -export * from './session'; +export * from './driver.ts'; +export * from './session.ts'; diff --git a/drizzle-orm/src/vercel-postgres/migrator.ts b/drizzle-orm/src/vercel-postgres/migrator.ts index 80f6724e9..4312d7307 100644 --- a/drizzle-orm/src/vercel-postgres/migrator.ts +++ b/drizzle-orm/src/vercel-postgres/migrator.ts @@ -1,6 +1,6 @@ -import type { MigrationConfig } from '~/migrator'; -import { readMigrationFiles } from '~/migrator'; -import type { VercelPgDatabase } from './driver'; +import type { MigrationConfig } from '~/migrator.ts'; +import { readMigrationFiles } from '~/migrator.ts'; +import type { VercelPgDatabase } from './driver.ts'; export async function migrate>( db: VercelPgDatabase, diff --git a/drizzle-orm/src/vercel-postgres/session.ts b/drizzle-orm/src/vercel-postgres/session.ts index e9b87051e..cbb714935 100644 --- a/drizzle-orm/src/vercel-postgres/session.ts +++ b/drizzle-orm/src/vercel-postgres/session.ts @@ -7,15 +7,15 @@ import { VercelPool, type VercelPoolClient, } from '@vercel/postgres'; -import { entityKind } from '~/entity'; -import { type Logger, NoopLogger } from '~/logger'; -import { type PgDialect, PgTransaction } from '~/pg-core'; -import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types'; -import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session'; -import { PgSession, PreparedQuery } from '~/pg-core/session'; -import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations'; -import { fillPlaceholders, type Query, sql } from '~/sql'; -import { type Assume, mapResultRow } from '~/utils'; +import { entityKind } from '~/entity.ts'; +import { type Logger, NoopLogger } from '~/logger.ts'; +import { type PgDialect, PgTransaction } from '~/pg-core/index.ts'; +import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts'; +import type { PgTransactionConfig, PreparedQueryConfig, QueryResultHKT } from '~/pg-core/session.ts'; +import { PgSession, PreparedQuery } from '~/pg-core/session.ts'; +import { type RelationalSchemaConfig, type TablesRelationalConfig } from '~/relations.ts'; +import { fillPlaceholders, type Query, sql } from '~/sql/index.ts'; +import { type Assume, mapResultRow } from '~/utils.ts'; export type VercelPgClient = VercelPool | VercelClient | VercelPoolClient; diff --git a/drizzle-orm/src/view.ts b/drizzle-orm/src/view.ts index 6d9aaabf2..28b912432 100644 --- a/drizzle-orm/src/view.ts +++ b/drizzle-orm/src/view.ts @@ -1,8 +1,8 @@ -import type { AnyColumn } from './column'; -import { entityKind } from './entity'; -import type { SelectedFields } from './operations'; -import { SQL, type SQLWrapper } from './sql'; -import type { Table } from './table'; +import type { AnyColumn } from './column.ts'; +import { entityKind } from './entity.ts'; +import type { SelectedFields } from './operations.ts'; +import { SQL, type SQLWrapper } from './sql/index.ts'; +import type { Table } from './table.ts'; export const ViewBaseConfig = Symbol.for('drizzle:ViewBaseConfig'); diff --git a/drizzle-orm/tests/is.test.ts b/drizzle-orm/tests/is.test.ts index 6b9b1b3c1..00bf6d2d1 100644 --- a/drizzle-orm/tests/is.test.ts +++ b/drizzle-orm/tests/is.test.ts @@ -1,6 +1,6 @@ import { describe, test } from 'vitest'; import { Column, is } from '~/index'; -import { PgArray, PgColumn, PgSerial, pgTable, serial } from '~/pg-core'; +import { PgArray, PgColumn, PgSerial, pgTable, serial } from '~/pg-core/index.ts'; const pgExampleTable = pgTable('test', { a: serial('a').array(), diff --git a/drizzle-orm/tests/makePgArray.test.ts b/drizzle-orm/tests/makePgArray.test.ts index b90899813..e37363a59 100644 --- a/drizzle-orm/tests/makePgArray.test.ts +++ b/drizzle-orm/tests/makePgArray.test.ts @@ -1,5 +1,5 @@ import { describe, it } from 'vitest'; -import { customType, pgTable } from '~/pg-core'; +import { customType, pgTable } from '~/pg-core/index.ts'; const anyColumn = customType<{ data: any }>({ dataType() { diff --git a/drizzle-orm/tests/parsePgArray.test.ts b/drizzle-orm/tests/parsePgArray.test.ts index 3b574b487..0b0abf4d2 100644 --- a/drizzle-orm/tests/parsePgArray.test.ts +++ b/drizzle-orm/tests/parsePgArray.test.ts @@ -1,5 +1,5 @@ import { describe, it } from 'vitest'; -import { customType, pgTable } from '~/pg-core'; +import { customType, pgTable } from '~/pg-core/index.ts'; const anyColumn = customType<{ data: any }>({ dataType() { diff --git a/drizzle-orm/tsconfig.build.json b/drizzle-orm/tsconfig.build.json new file mode 100644 index 000000000..f8c8deaeb --- /dev/null +++ b/drizzle-orm/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "composite": true, + "baseUrl": ".", + "verbatimModuleSyntax": true, + "moduleResolution": "NodeNext", + "allowImportingTsExtensions": true, + "noEmit": true, + "incremental": true, + "paths": { + "~/*": ["src/*"] + }, + "outDir": "dist.new" + }, + "include": ["src"] +} diff --git a/drizzle-orm/tsconfig.cjs.json b/drizzle-orm/tsconfig.cjs.json index 72bb4f1c4..fa57f71e1 100644 --- a/drizzle-orm/tsconfig.cjs.json +++ b/drizzle-orm/tsconfig.cjs.json @@ -1,9 +1,8 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.build.json", "compilerOptions": { "target": "es2020", "module": "es2020", "rootDir": "src" - }, - "include": ["src"] + } } diff --git a/drizzle-orm/tsconfig.config.json b/drizzle-orm/tsconfig.config.json new file mode 100644 index 000000000..2fe7f262b --- /dev/null +++ b/drizzle-orm/tsconfig.config.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "composite": true + }, + "include": ["./*.ts", "scripts"] +} diff --git a/drizzle-orm/tsconfig.dts.json b/drizzle-orm/tsconfig.dts.json index 3377281ba..4627d6a2c 100644 --- a/drizzle-orm/tsconfig.dts.json +++ b/drizzle-orm/tsconfig.dts.json @@ -1,7 +1,13 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.build.json", "compilerOptions": { - "rootDir": "src" + "composite": false, + "rootDir": "src", + "outDir": "dist-dts", + "declaration": true, + "noEmit": false, + "emitDeclarationOnly": true, + "incremental": false }, "include": ["src"] } diff --git a/drizzle-orm/tsconfig.esm.json b/drizzle-orm/tsconfig.esm.json index 3377281ba..4a7f09d1d 100644 --- a/drizzle-orm/tsconfig.esm.json +++ b/drizzle-orm/tsconfig.esm.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.build.json", "compilerOptions": { "rootDir": "src" }, diff --git a/drizzle-orm/tsconfig.json b/drizzle-orm/tsconfig.json index 3069a91da..c63720fd3 100644 --- a/drizzle-orm/tsconfig.json +++ b/drizzle-orm/tsconfig.json @@ -1,10 +1,12 @@ { - "extends": "../tsconfig.json", - "compilerOptions": { - "baseUrl": ".", - "paths": { - "~/*": ["src/*"] + "files": [], + "references": [ + { + "path": "./tsconfig.build.json" + }, + { + "path": "./tsconfig.config.json" } - }, - "include": ["src", "*.ts"] + ], + "include": ["rollup.*.ts"] } diff --git a/drizzle-orm/type-tests/knex/index.ts b/drizzle-orm/type-tests/knex/index.ts index 8deacac0c..222247ea3 100644 --- a/drizzle-orm/type-tests/knex/index.ts +++ b/drizzle-orm/type-tests/knex/index.ts @@ -1,7 +1,7 @@ -import Knex from 'knex'; -import { type Equal, Expect } from 'type-tests/utils'; -import { pgTable, serial, text } from '~/pg-core'; -import type { PromiseOf } from '~/utils'; +import { knex } from 'knex'; +import { type Equal, Expect } from 'type-tests/utils.ts'; +import { pgTable, serial, text } from '~/pg-core/index.ts'; +import type { PromiseOf } from '~/utils.ts'; import '~/knex'; const test = pgTable('test', { @@ -9,13 +9,13 @@ const test = pgTable('test', { name: text('name').notNull(), }); -declare module 'knex/types/tables' { +declare module 'knex/types/tables.ts' { interface Tables { test: Knexify; } } -const db = Knex({}); +const db = knex({}); { const res = db('test').select(); diff --git a/drizzle-orm/type-tests/kysely/index.ts b/drizzle-orm/type-tests/kysely/index.ts index b2e4240c4..ecb49810f 100644 --- a/drizzle-orm/type-tests/kysely/index.ts +++ b/drizzle-orm/type-tests/kysely/index.ts @@ -1,11 +1,10 @@ import { Kysely, PostgresDialect } from 'kysely'; import { Pool } from 'pg'; -import { type Equal, Expect } from 'type-tests/utils'; -import type { Kyselify } from '~/kysely'; -import { char, mysqlTable, timestamp as mysqlTimestamp, varchar as mysqlVarchar } from '~/mysql-core'; -import { integer, pgEnum, pgTable, serial, text, timestamp, varchar } from '~/pg-core'; -import type { InferModel } from '~/table'; -import type { PromiseOf } from '~/utils'; +import { type Equal, Expect } from 'type-tests/utils.ts'; +import type { Kyselify } from '~/kysely/index.ts'; +import { char, mysqlTable, timestamp as mysqlTimestamp, varchar as mysqlVarchar } from '~/mysql-core/index.ts'; +import { integer, pgEnum, pgTable, serial, text, timestamp, varchar } from '~/pg-core/index.ts'; +import type { PromiseOf } from '~/utils.ts'; const test = pgTable('test', { id: serial('id').primaryKey(), @@ -23,7 +22,7 @@ const db = new Kysely({ }); const result = db.selectFrom('test').selectAll().execute(); -Expect, InferModel[]>>(); +Expect, typeof test.$inferSelect[]>>(); { const units = mysqlTable('units', { diff --git a/drizzle-orm/type-tests/mysql/1-to-1-fk.ts b/drizzle-orm/type-tests/mysql/1-to-1-fk.ts index 907085761..c3e41e33c 100644 --- a/drizzle-orm/type-tests/mysql/1-to-1-fk.ts +++ b/drizzle-orm/type-tests/mysql/1-to-1-fk.ts @@ -1,5 +1,5 @@ -import { int, serial } from '~/mysql-core/columns'; -import { mysqlTable } from '~/mysql-core/table'; +import { int, serial } from '~/mysql-core/columns/index.ts'; +import { mysqlTable } from '~/mysql-core/table.ts'; const test1 = mysqlTable('test1_table', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/mysql/1000columns.ts b/drizzle-orm/type-tests/mysql/1000columns.ts index ab80e352f..f0c35d3e2 100644 --- a/drizzle-orm/type-tests/mysql/1000columns.ts +++ b/drizzle-orm/type-tests/mysql/1000columns.ts @@ -1,4 +1,4 @@ -import { bigint, double, mysqlTable, varchar } from '~/mysql-core'; +import { bigint, double, mysqlTable, varchar } from '~/mysql-core/index.ts'; mysqlTable('test', { col0: double('col1').primaryKey().autoincrement().default(0), diff --git a/drizzle-orm/type-tests/mysql/db-rel.ts b/drizzle-orm/type-tests/mysql/db-rel.ts index ebee4a235..0d528b186 100644 --- a/drizzle-orm/type-tests/mysql/db-rel.ts +++ b/drizzle-orm/type-tests/mysql/db-rel.ts @@ -1,8 +1,8 @@ import pg from 'pg'; -import { type Equal, Expect } from 'type-tests/utils'; -import { drizzle } from '~/node-postgres'; -import { placeholder, sql } from '~/sql'; -import * as schema from './tables-rel'; +import { type Equal, Expect } from 'type-tests/utils.ts'; +import { drizzle } from '~/node-postgres/index.ts'; +import { placeholder, sql } from '~/sql/index.ts'; +import * as schema from './tables-rel.ts'; const { Pool } = pg; diff --git a/drizzle-orm/type-tests/mysql/db.ts b/drizzle-orm/type-tests/mysql/db.ts index 5c24eb397..ac32f645e 100644 --- a/drizzle-orm/type-tests/mysql/db.ts +++ b/drizzle-orm/type-tests/mysql/db.ts @@ -1,5 +1,5 @@ import { createPool } from 'mysql2/promise'; -import { drizzle } from '~/mysql2'; +import { drizzle } from '~/mysql2/index.ts'; const pool = createPool({}); diff --git a/drizzle-orm/type-tests/mysql/delete.ts b/drizzle-orm/type-tests/mysql/delete.ts index e86076290..0842ae963 100644 --- a/drizzle-orm/type-tests/mysql/delete.ts +++ b/drizzle-orm/type-tests/mysql/delete.ts @@ -1,9 +1,9 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { eq } from '~/expressions'; -import type { MySqlRawQueryResult } from '~/mysql2'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { eq } from '~/expressions.ts'; +import type { MySqlRawQueryResult } from '~/mysql2/index.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const deleteAll = await db.delete(users); Expect>; diff --git a/drizzle-orm/type-tests/mysql/insert.ts b/drizzle-orm/type-tests/mysql/insert.ts index 8de4f4d3f..ab5cb5ee4 100644 --- a/drizzle-orm/type-tests/mysql/insert.ts +++ b/drizzle-orm/type-tests/mysql/insert.ts @@ -1,10 +1,10 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { int, mysqlTable, text } from '~/mysql-core'; -import type { MySqlRawQueryResult } from '~/mysql2'; -import { sql } from '~/sql'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { int, mysqlTable, text } from '~/mysql-core/index.ts'; +import type { MySqlRawQueryResult } from '~/mysql2/index.ts'; +import { sql } from '~/sql/index.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const insert = await db.insert(users).values({ homeCity: 1, diff --git a/drizzle-orm/type-tests/mysql/select.ts b/drizzle-orm/type-tests/mysql/select.ts index b4ab1706c..17c9d12b3 100644 --- a/drizzle-orm/type-tests/mysql/select.ts +++ b/drizzle-orm/type-tests/mysql/select.ts @@ -20,15 +20,14 @@ import { notInArray, notLike, or, -} from '~/expressions'; -import { alias } from '~/mysql-core/alias'; -import { param, sql } from '~/sql'; +} from '~/expressions.ts'; +import { alias } from '~/mysql-core/alias.ts'; +import { param, sql } from '~/sql/index.ts'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { type InferModel } from '~/table'; -import { db } from './db'; -import { cities, classes, newYorkers, users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { db } from './db.ts'; +import { cities, classes, newYorkers, users } from './tables.ts'; const city = alias(cities, 'city'); const city1 = alias(cities, 'city1'); @@ -431,6 +430,6 @@ await db { const query = db.select().from(users).prepare().iterator(); for await (const row of query) { - Expect, typeof row>>(); + Expect>(); } } diff --git a/drizzle-orm/type-tests/mysql/subquery.ts b/drizzle-orm/type-tests/mysql/subquery.ts index 2e1d9c539..920520e45 100644 --- a/drizzle-orm/type-tests/mysql/subquery.ts +++ b/drizzle-orm/type-tests/mysql/subquery.ts @@ -1,9 +1,9 @@ -import { Expect } from 'type-tests/utils'; -import { and, eq } from '~/expressions'; -import { alias, int, mysqlTable, serial, text } from '~/mysql-core'; -import { sql } from '~/sql'; -import type { DrizzleTypeError, Equal } from '~/utils'; -import { db } from './db'; +import { Expect } from 'type-tests/utils.ts'; +import { and, eq } from '~/expressions.ts'; +import { alias, int, mysqlTable, serial, text } from '~/mysql-core/index.ts'; +import { sql } from '~/sql/index.ts'; +import type { DrizzleTypeError, Equal } from '~/utils.ts'; +import { db } from './db.ts'; const names = mysqlTable('names', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/mysql/tables-rel.ts b/drizzle-orm/type-tests/mysql/tables-rel.ts index 3330fb13e..28c2f0191 100644 --- a/drizzle-orm/type-tests/mysql/tables-rel.ts +++ b/drizzle-orm/type-tests/mysql/tables-rel.ts @@ -1,5 +1,5 @@ -import { foreignKey, int, mysqlTable, serial, text, timestamp } from '~/mysql-core'; -import { relations } from '~/relations'; +import { foreignKey, int, mysqlTable, serial, text, timestamp } from '~/mysql-core/index.ts'; +import { relations } from '~/relations.ts'; export const users = mysqlTable('users', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/mysql/tables.ts b/drizzle-orm/type-tests/mysql/tables.ts index 22d00cb12..ea1aaf42d 100644 --- a/drizzle-orm/type-tests/mysql/tables.ts +++ b/drizzle-orm/type-tests/mysql/tables.ts @@ -1,6 +1,6 @@ -import { type Equal, Expect } from 'type-tests/utils'; -import { eq, gt } from '~/expressions'; -import { type BuildColumn, type Simplify } from '~/index'; +import { type Equal, Expect } from 'type-tests/utils.ts'; +import { eq, gt } from '~/expressions.ts'; +import { type BuildColumn, type InferSelectModel, type Simplify } from '~/index.ts'; import { bigint, char, @@ -24,12 +24,11 @@ import { tinytext, uniqueIndex, varchar, -} from '~/mysql-core'; -import { mysqlSchema } from '~/mysql-core/schema'; -import { mysqlView, type MySqlViewWithSelection } from '~/mysql-core/view'; -import { sql } from '~/sql'; -import type { InferModel } from '~/table'; -import { db } from './db'; +} from '~/mysql-core/index.ts'; +import { mysqlSchema } from '~/mysql-core/schema.ts'; +import { mysqlView, type MySqlViewWithSelection } from '~/mysql-core/view.ts'; +import { sql } from '~/sql/index.ts'; +import { db } from './db.ts'; export const users = mysqlTable( 'users_table', @@ -79,7 +78,7 @@ Expect< id: number; name_db: string; population: number | null; - }, InferModel> + }, InferSelectModel> >; export const customSchema = mysqlSchema('custom_schema'); diff --git a/drizzle-orm/type-tests/mysql/with.ts b/drizzle-orm/type-tests/mysql/with.ts index 6019ec053..eb36e520f 100644 --- a/drizzle-orm/type-tests/mysql/with.ts +++ b/drizzle-orm/type-tests/mysql/with.ts @@ -1,9 +1,9 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { gt, inArray } from '~/expressions'; -import { int, mysqlTable, serial, text } from '~/mysql-core'; -import { sql } from '~/sql'; -import { db } from './db'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { gt, inArray } from '~/expressions.ts'; +import { int, mysqlTable, serial, text } from '~/mysql-core/index.ts'; +import { sql } from '~/sql/index.ts'; +import { db } from './db.ts'; const orders = mysqlTable('orders', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/pg/1-to-1-fk.ts b/drizzle-orm/type-tests/pg/1-to-1-fk.ts index 182edf0e4..0fb34e490 100644 --- a/drizzle-orm/type-tests/pg/1-to-1-fk.ts +++ b/drizzle-orm/type-tests/pg/1-to-1-fk.ts @@ -1,5 +1,5 @@ -import { integer, type PgColumn, serial } from '~/pg-core/columns'; -import { pgTable } from '~/pg-core/table'; +import { integer, type PgColumn, serial } from '~/pg-core/columns/index.ts'; +import { pgTable } from '~/pg-core/table.ts'; { const test1 = pgTable('test1_table', { diff --git a/drizzle-orm/type-tests/pg/array.ts b/drizzle-orm/type-tests/pg/array.ts index d5c6b56eb..104849901 100644 --- a/drizzle-orm/type-tests/pg/array.ts +++ b/drizzle-orm/type-tests/pg/array.ts @@ -1,6 +1,6 @@ -import { type Equal, Expect } from 'type-tests/utils'; -import { type Column } from '~/column'; -import { integer, pgTable } from '~/pg-core'; +import { type Equal, Expect } from 'type-tests/utils.ts'; +import { type Column } from '~/column.ts'; +import { integer, pgTable } from '~/pg-core/index.ts'; { const table = pgTable('table', { diff --git a/drizzle-orm/type-tests/pg/db-rel.ts b/drizzle-orm/type-tests/pg/db-rel.ts index fae2be03a..3e90fbb8e 100644 --- a/drizzle-orm/type-tests/pg/db-rel.ts +++ b/drizzle-orm/type-tests/pg/db-rel.ts @@ -1,8 +1,8 @@ import pg from 'pg'; -import { type Equal, Expect } from 'type-tests/utils'; -import { drizzle } from '~/node-postgres'; -import { placeholder, sql } from '~/sql'; -import * as schema from './tables-rel'; +import { type Equal, Expect } from 'type-tests/utils.ts'; +import { drizzle } from '~/node-postgres/index.ts'; +import { sql } from '~/sql/index.ts'; +import * as schema from './tables-rel.ts'; const { Pool } = pg; @@ -12,12 +12,12 @@ const db = drizzle(pdb, { schema }); { const result = await db.query.users.findMany({ where: (users, { sql }) => sql`char_length(${users.name} > 1)`, - limit: placeholder('l'), + limit: sql.placeholder('l'), orderBy: (users, { asc, desc }) => [asc(users.name), desc(users.id)], with: { posts: { where: (posts, { sql }) => sql`char_length(${posts.title} > 1)`, - limit: placeholder('l'), + limit: sql.placeholder('l'), columns: { id: false, title: undefined, @@ -26,7 +26,7 @@ const db = drizzle(pdb, { schema }); author: true, comments: { where: (comments, { sql }) => sql`char_length(${comments.text} > 1)`, - limit: placeholder('l'), + limit: sql.placeholder('l'), columns: { text: true, }, diff --git a/drizzle-orm/type-tests/pg/db.ts b/drizzle-orm/type-tests/pg/db.ts index cadabfbd5..c9a0dd05e 100644 --- a/drizzle-orm/type-tests/pg/db.ts +++ b/drizzle-orm/type-tests/pg/db.ts @@ -1,4 +1,4 @@ import { Client } from 'pg'; -import { drizzle } from '~/node-postgres'; +import { drizzle } from '~/node-postgres/index.ts'; export const db = drizzle(new Client()); diff --git a/drizzle-orm/type-tests/pg/delete.ts b/drizzle-orm/type-tests/pg/delete.ts index d19727e9b..66eddc0c3 100644 --- a/drizzle-orm/type-tests/pg/delete.ts +++ b/drizzle-orm/type-tests/pg/delete.ts @@ -1,10 +1,9 @@ import type { QueryResult } from 'pg'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { eq } from '~/expressions'; -import type { InferModel } from '~/table'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { eq } from '~/expressions.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const deleteAll = await db.delete(users); Expect, typeof deleteAll>>; @@ -21,11 +20,11 @@ const deleteWherePrepared = await deleteWhereStmt.execute(); Expect, typeof deleteWherePrepared>>; const deleteReturningAll = await db.delete(users).returning(); -Expect[], typeof deleteReturningAll>>; +Expect>; const deleteReturningAllStmt = db.delete(users).returning().prepare('deleteReturningAllStmt'); const deleteReturningAllPrepared = await deleteReturningAllStmt.execute(); -Expect[], typeof deleteReturningAllPrepared>>; +Expect>; const deleteReturningPartial = await db.delete(users).returning({ myId: users.id, diff --git a/drizzle-orm/type-tests/pg/insert.ts b/drizzle-orm/type-tests/pg/insert.ts index 88078269b..19aca71c3 100644 --- a/drizzle-orm/type-tests/pg/insert.ts +++ b/drizzle-orm/type-tests/pg/insert.ts @@ -1,10 +1,9 @@ import type { QueryResult } from 'pg'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { sql } from '~/sql'; -import type { InferModel } from '~/table'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { sql } from '~/sql/index.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const insert = await db .insert(users) @@ -57,7 +56,7 @@ const insertReturning = await db enumCol: 'a', }) .returning(); -Expect[], typeof insertReturning>>; +Expect>; const insertReturningStmt = db .insert(users) @@ -70,7 +69,7 @@ const insertReturningStmt = db .returning() .prepare('insertReturningStmt'); const insertReturningPrepared = await insertReturningStmt.execute(); -Expect[], typeof insertReturningPrepared>>; +Expect>; const insertReturningPartial = await db .insert(users) diff --git a/drizzle-orm/type-tests/pg/other.ts b/drizzle-orm/type-tests/pg/other.ts index 8b61a4e92..e1e781402 100644 --- a/drizzle-orm/type-tests/pg/other.ts +++ b/drizzle-orm/type-tests/pg/other.ts @@ -1,11 +1,11 @@ import type { QueryResult } from 'pg'; -import { eq, inArray } from '~/expressions'; -import { sql } from '~/sql'; +import { eq, inArray } from '~/expressions.ts'; +import { sql } from '~/sql/index.ts'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const rawQuery = await db.execute( sql`select ${users.id}, ${users.class} from ${users} where ${inArray(users.id, [1, 2, 3])} and ${ diff --git a/drizzle-orm/type-tests/pg/select.ts b/drizzle-orm/type-tests/pg/select.ts index daac279ba..383aaf345 100644 --- a/drizzle-orm/type-tests/pg/select.ts +++ b/drizzle-orm/type-tests/pg/select.ts @@ -1,5 +1,5 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; import { and, @@ -23,15 +23,14 @@ import { notInArray, notLike, or, -} from '~/expressions'; -import { boolean, integer, pgTable, text } from '~/pg-core'; -import { alias } from '~/pg-core/alias'; -import type { AnyPgSelect } from '~/pg-core/query-builders/select.types'; -import { param, type SQL, sql } from '~/sql'; -import type { InferModel } from '~/table'; +} from '~/expressions.ts'; +import { alias } from '~/pg-core/alias.ts'; +import { boolean, integer, pgTable, text } from '~/pg-core/index.ts'; +import type { AnyPgSelect } from '~/pg-core/query-builders/select.types.ts'; +import { type SQL, sql } from '~/sql/index.ts'; -import { db } from './db'; -import { cities, classes, newYorkers, newYorkers2, users } from './tables'; +import { db } from './db.ts'; +import { cities, classes, newYorkers, newYorkers2, users } from './tables.ts'; const city = alias(cities, 'city'); const city1 = alias(cities, 'city1'); @@ -45,8 +44,8 @@ const leftJoinFull = await db.select().from(users).leftJoin(city, eq(users.id, c Expect< Equal< { - users_table: InferModel; - city: InferModel | null; + users_table: typeof users.$inferSelect; + city: typeof cities.$inferSelect | null; }[], typeof leftJoinFull > @@ -57,8 +56,8 @@ const rightJoinFull = await db.select().from(users).rightJoin(city, eq(users.id, Expect< Equal< { - users_table: InferModel | null; - city: InferModel; + users_table: typeof users.$inferSelect | null; + city: typeof city.$inferSelect; }[], typeof rightJoinFull > @@ -69,8 +68,8 @@ const innerJoinFull = await db.select().from(users).innerJoin(city, eq(users.id, Expect< Equal< { - users_table: InferModel; - city: InferModel; + users_table: typeof users.$inferSelect; + city: typeof city.$inferSelect; }[], typeof innerJoinFull > @@ -81,8 +80,8 @@ const fullJoinFull = await db.select().from(users).fullJoin(city, eq(users.id, c Expect< Equal< { - users_table: InferModel | null; - city: InferModel | null; + users_table: typeof users.$inferSelect | null; + city: typeof city.$inferSelect | null; }[], typeof fullJoinFull > @@ -380,15 +379,15 @@ const allOperators = await db col6: sql`true`, // boolean col7: sql`random()`, // number col8: sql`some_funky_func(${users.id})`.mapWith(mapFunkyFuncResult), // { foo: string } - col9: sql`greatest(${users.createdAt}, ${param(new Date(), users.createdAt)})`, // unknown + col9: sql`greatest(${users.createdAt}, ${sql.param(new Date(), users.createdAt)})`, // unknown col10: sql`date_or_false(${users.createdAt}, ${ - param( + sql.param( new Date(), users.createdAt, ) })`, // Date | boolean col11: sql`${users.age1} + ${age}`, // unknown - col12: sql`${users.age1} + ${param(age, users.age1)}`, // unknown + col12: sql`${users.age1} + ${sql.param(age, users.age1)}`, // unknown col13: sql`lower(${users.class})`, // unknown col14: sql`length(${users.class})`, // number count: sql`count(*)::int`, // number diff --git a/drizzle-orm/type-tests/pg/subquery.ts b/drizzle-orm/type-tests/pg/subquery.ts index 184b2151a..0af17ccf8 100644 --- a/drizzle-orm/type-tests/pg/subquery.ts +++ b/drizzle-orm/type-tests/pg/subquery.ts @@ -1,9 +1,9 @@ -import { Expect } from 'type-tests/utils'; -import { and, eq } from '~/expressions'; -import { alias, integer, pgTable, serial, text } from '~/pg-core'; -import { sql } from '~/sql'; -import type { DrizzleTypeError, Equal } from '~/utils'; -import { db } from './db'; +import { Expect } from 'type-tests/utils.ts'; +import { and, eq } from '~/expressions.ts'; +import { alias, integer, pgTable, serial, text } from '~/pg-core/index.ts'; +import { sql } from '~/sql/index.ts'; +import type { DrizzleTypeError, Equal } from '~/utils.ts'; +import { db } from './db.ts'; const names = pgTable('names', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/pg/tables-rel.ts b/drizzle-orm/type-tests/pg/tables-rel.ts index bd22a960a..9be999a33 100644 --- a/drizzle-orm/type-tests/pg/tables-rel.ts +++ b/drizzle-orm/type-tests/pg/tables-rel.ts @@ -1,5 +1,5 @@ -import { foreignKey, integer, pgTable, serial, text, timestamp } from '~/pg-core'; -import { relations } from '~/relations'; +import { foreignKey, integer, pgTable, serial, text, timestamp } from '~/pg-core/index.ts'; +import { relations } from '~/relations.ts'; export const users = pgTable('users', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/pg/tables.ts b/drizzle-orm/type-tests/pg/tables.ts index dcaa60e4a..6dcdc3867 100644 --- a/drizzle-orm/type-tests/pg/tables.ts +++ b/drizzle-orm/type-tests/pg/tables.ts @@ -1,8 +1,8 @@ import crypto from 'node:crypto'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; import { z } from 'zod'; -import { eq, gt } from '~/expressions'; +import { eq, gt } from '~/expressions.ts'; import { bigint, bigserial, @@ -37,17 +37,17 @@ import { uniqueIndex, uuid, varchar, -} from '~/pg-core'; -import { pgSchema } from '~/pg-core/schema'; +} from '~/pg-core/index.ts'; +import { pgSchema } from '~/pg-core/schema.ts'; import { pgMaterializedView, type PgMaterializedViewWithSelection, pgView, type PgViewWithSelection, -} from '~/pg-core/view'; -import { sql } from '~/sql'; -import type { InferInsertModel, InferModel, InferSelectModel } from '~/table'; -import { db } from './db'; +} from '~/pg-core/view.ts'; +import { sql } from '~/sql/index.ts'; +import type { InferInsertModel, InferSelectModel } from '~/table.ts'; +import { db } from './db.ts'; export const myEnum = pgEnum('my_enum', ['a', 'b', 'c']); @@ -123,7 +123,7 @@ Expect< cidr: string; macaddr: string; macaddr8: string; - }, InferModel> + }, typeof network.$inferSelect> >; export const salEmp = pgTable('sal_emp', { @@ -870,7 +870,7 @@ await db.refreshMaterializedView(newYorkers2).withNoData().concurrently(); const test = pgTable('test', { col1: decimal('col1', { precision: 10, scale: 2 }).notNull().default('10.2'), }); - Expect>>; + Expect>; } { diff --git a/drizzle-orm/type-tests/pg/update.ts b/drizzle-orm/type-tests/pg/update.ts index 17cc7d5d6..4123b26fe 100644 --- a/drizzle-orm/type-tests/pg/update.ts +++ b/drizzle-orm/type-tests/pg/update.ts @@ -1,9 +1,9 @@ import type { QueryResult } from 'pg'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { eq } from '~/expressions'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { eq } from '~/expressions.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const update = await db.update(users) .set({ diff --git a/drizzle-orm/type-tests/pg/with.ts b/drizzle-orm/type-tests/pg/with.ts index a1690ed96..49fc10f3b 100644 --- a/drizzle-orm/type-tests/pg/with.ts +++ b/drizzle-orm/type-tests/pg/with.ts @@ -1,9 +1,9 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { gt, inArray } from '~/expressions'; -import { integer, pgTable, serial, text } from '~/pg-core'; -import { sql } from '~/sql'; -import { db } from './db'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { gt, inArray } from '~/expressions.ts'; +import { integer, pgTable, serial, text } from '~/pg-core/index.ts'; +import { sql } from '~/sql/index.ts'; +import { db } from './db.ts'; const orders = pgTable('orders', { id: serial('id').primaryKey(), diff --git a/drizzle-orm/type-tests/sqlite/db.ts b/drizzle-orm/type-tests/sqlite/db.ts index f29b6f22e..07af338d4 100644 --- a/drizzle-orm/type-tests/sqlite/db.ts +++ b/drizzle-orm/type-tests/sqlite/db.ts @@ -1,8 +1,8 @@ import Database from 'better-sqlite3'; import { Database as BunDatabase } from 'bun:sqlite'; -import { drizzle as drizzleBetterSqlite3 } from '~/better-sqlite3'; -import { drizzle as drizzleBun } from '~/bun-sqlite'; -import { drizzle as drizzleD1 } from '~/d1'; +import { drizzle as drizzleBetterSqlite3 } from '~/better-sqlite3/index.ts'; +import { drizzle as drizzleBun } from '~/bun-sqlite/index.ts'; +import { drizzle as drizzleD1 } from '~/d1/index.ts'; const client = new Database(':memory:'); const bunClient = new BunDatabase(':memory:'); diff --git a/drizzle-orm/type-tests/sqlite/delete.ts b/drizzle-orm/type-tests/sqlite/delete.ts index d10a8103d..10827099f 100644 --- a/drizzle-orm/type-tests/sqlite/delete.ts +++ b/drizzle-orm/type-tests/sqlite/delete.ts @@ -1,12 +1,11 @@ import type { RunResult } from 'better-sqlite3'; -import { eq } from '~/expressions'; +import { eq } from '~/expressions.ts'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import type { InferModel } from '~/table'; -import { type DrizzleTypeError } from '~/utils'; -import { bunDb, db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { type DrizzleTypeError } from '~/utils.ts'; +import { bunDb, db } from './db.ts'; +import { users } from './tables.ts'; const deleteRun = db.delete(users).run(); Expect>; @@ -60,10 +59,10 @@ const deleteRunReturning = db.delete(users).returning().run(); Expect>; const deleteAllReturning = db.delete(users).returning().all(); -Expect[], typeof deleteAllReturning>>; +Expect>; const deleteGetReturning = db.delete(users).returning().get(); -Expect | undefined, typeof deleteGetReturning>>; +Expect>; const deleteValuesReturning = db.delete(users).returning().values(); Expect>; @@ -72,10 +71,10 @@ const deleteRunBunReturning = bunDb.delete(users).returning().run(); Expect>; const deleteAllBunReturning = bunDb.delete(users).returning().all(); -Expect[], typeof deleteAllBunReturning>>; +Expect>; const deleteGetBunReturning = bunDb.delete(users).returning().get(); -Expect | undefined, typeof deleteGetBunReturning>>; +Expect>; const deleteValuesBunReturning = bunDb.delete(users).returning().values(); Expect>; diff --git a/drizzle-orm/type-tests/sqlite/insert.ts b/drizzle-orm/type-tests/sqlite/insert.ts index 0e80b2e92..cc877686c 100644 --- a/drizzle-orm/type-tests/sqlite/insert.ts +++ b/drizzle-orm/type-tests/sqlite/insert.ts @@ -1,13 +1,12 @@ import type { RunResult } from 'better-sqlite3'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { and, eq } from '~/expressions'; -import { placeholder, sql } from '~/sql'; -import type { InferModel } from '~/table'; -import { type DrizzleTypeError } from '~/utils'; -import { bunDb, db } from './db'; -import type { NewUser } from './tables'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { and, eq } from '~/expressions.ts'; +import { sql } from '~/sql/index.ts'; +import { type DrizzleTypeError } from '~/utils.ts'; +import { bunDb, db } from './db.ts'; +import type { NewUser } from './tables.ts'; +import { users } from './tables.ts'; const newUser: NewUser = { homeCity: 1, @@ -48,16 +47,16 @@ const insertRunReturningAllBun = bunDb.insert(users).values(newUser).returning() Expect>; const insertAllReturningAll = db.insert(users).values(newUser).returning().all(); -Expect[], typeof insertAllReturningAll>>; +Expect>; const insertAllReturningAllBun = bunDb.insert(users).values(newUser).returning().all(); -Expect[], typeof insertAllReturningAllBun>>; +Expect>; const insertGetReturningAll = db.insert(users).values(newUser).returning().get(); -Expect, typeof insertGetReturningAll>>; +Expect>; const insertGetReturningAllBun = bunDb.insert(users).values(newUser).returning().get(); -Expect, typeof insertGetReturningAllBun>>; +Expect>; const insertValuesReturningAll = db.insert(users).values(newUser).returning().values(); Expect>; @@ -167,8 +166,8 @@ db.insert(users).values(newUser) .run(); const stmt = db.select().from(users) - .where(and(eq(users.id, placeholder('id')))) - .offset(placeholder('offset')) - .limit(placeholder('limit')) + .where(and(eq(users.id, sql.placeholder('id')))) + .offset(sql.placeholder('offset')) + .limit(sql.placeholder('limit')) .prepare(); stmt.run({ id: 1, limit: 10, offset: 20 }); diff --git a/drizzle-orm/type-tests/sqlite/other.ts b/drizzle-orm/type-tests/sqlite/other.ts index 702193dff..aa4960371 100644 --- a/drizzle-orm/type-tests/sqlite/other.ts +++ b/drizzle-orm/type-tests/sqlite/other.ts @@ -1,11 +1,11 @@ import type { RunResult } from 'better-sqlite3'; -import { eq, inArray } from '~/expressions'; -import { sql } from '~/sql'; +import { eq, inArray } from '~/expressions.ts'; +import { sql } from '~/sql/index.ts'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { db } from './db'; -import { users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { db } from './db.ts'; +import { users } from './tables.ts'; const query = sql`select ${users.id}, ${users.class} from ${users} where ${inArray(users.id, [1, 2, 3])} and ${ eq(users.class, 'A') diff --git a/drizzle-orm/type-tests/sqlite/select.ts b/drizzle-orm/type-tests/sqlite/select.ts index 2bf71591d..ad9ef2cf2 100644 --- a/drizzle-orm/type-tests/sqlite/select.ts +++ b/drizzle-orm/type-tests/sqlite/select.ts @@ -20,15 +20,14 @@ import { notInArray, notLike, or, -} from '~/expressions'; -import { param, sql } from '~/sql'; -import { alias } from '~/sqlite-core/alias'; +} from '~/expressions.ts'; +import { param, sql } from '~/sql/index.ts'; +import { alias } from '~/sqlite-core/alias.ts'; -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import type { InferModel } from '~/table'; -import { db } from './db'; -import { cities, classes, newYorkers, users } from './tables'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { db } from './db.ts'; +import { cities, classes, newYorkers, users } from './tables.ts'; const city = alias(cities, 'city'); const city1 = alias(cities, 'city1'); @@ -42,10 +41,10 @@ const joinAll = db .all(); Expect< Equal<{ - users_table: InferModel | null; - cities_table: InferModel | null; - city: InferModel | null; - city1: InferModel; + users_table: typeof users.$inferSelect | null; + cities_table: typeof cities.$inferSelect | null; + city: typeof city.$inferSelect | null; + city1: typeof city1.$inferSelect; }[], typeof joinAll> >; @@ -59,10 +58,10 @@ const joinGet = db Expect< Equal< { - users_table: InferModel | null; - cities_table: InferModel | null; - city: InferModel | null; - city1: InferModel; + users_table: typeof users.$inferSelect | null; + cities_table: typeof cities.$inferSelect | null; + city: typeof city.$inferSelect | null; + city1: typeof city1.$inferSelect; } | undefined, typeof joinGet > diff --git a/drizzle-orm/type-tests/sqlite/subquery.ts b/drizzle-orm/type-tests/sqlite/subquery.ts index abd76013d..87926864e 100644 --- a/drizzle-orm/type-tests/sqlite/subquery.ts +++ b/drizzle-orm/type-tests/sqlite/subquery.ts @@ -1,9 +1,9 @@ -import { Expect } from 'type-tests/utils'; -import { and, eq } from '~/expressions'; -import { sql } from '~/sql'; -import { alias, integer, sqliteTable, text } from '~/sqlite-core'; -import type { DrizzleTypeError, Equal } from '~/utils'; -import { db } from './db'; +import { Expect } from 'type-tests/utils.ts'; +import { and, eq } from '~/expressions.ts'; +import { sql } from '~/sql/index.ts'; +import { alias, integer, sqliteTable, text } from '~/sqlite-core/index.ts'; +import type { DrizzleTypeError, Equal } from '~/utils.ts'; +import { db } from './db.ts'; const names = sqliteTable('names', { id: integer('id').primaryKey(), diff --git a/drizzle-orm/type-tests/sqlite/tables.ts b/drizzle-orm/type-tests/sqlite/tables.ts index 3db702b7c..eef6ec377 100644 --- a/drizzle-orm/type-tests/sqlite/tables.ts +++ b/drizzle-orm/type-tests/sqlite/tables.ts @@ -1,7 +1,7 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { eq, gt } from '~/expressions'; -import { sql } from '~/sql'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { eq, gt } from '~/expressions.ts'; +import { sql } from '~/sql/index.ts'; import { alias, check, @@ -13,10 +13,9 @@ import { sqliteTable, text, uniqueIndex, -} from '~/sqlite-core'; -import { sqliteView, type SQLiteViewWithSelection } from '~/sqlite-core/view'; -import type { InferModel } from '~/table'; -import { db } from './db'; +} from '~/sqlite-core/index.ts'; +import { sqliteView, type SQLiteViewWithSelection } from '~/sqlite-core/view.ts'; +import { db } from './db.ts'; export const users = sqliteTable( 'users_table', @@ -58,7 +57,7 @@ export const users = sqliteTable( }), ); -export type User = InferModel; +export type User = typeof users.$inferSelect; Expect< Equal >; -export type NewUser = InferModel; +export type NewUser = typeof users.$inferInsert; Expect< Equal; +export type City = typeof cities.$inferSelect; Expect< Equal >; -export type NewCity = InferModel; +export type NewCity = typeof cities.$inferInsert; Expect< Equal; +export type Class = typeof classes.$inferSelect; Expect< Equal >; -export type NewClass = InferModel; +export type NewClass = typeof classes.$inferInsert; Expect< Equal[], typeof updateAllReturningAll>>; +Expect>; const updateAllReturningAllBun = bunDb.update(users) .set({ @@ -73,7 +72,7 @@ const updateAllReturningAllBun = bunDb.update(users) .where(eq(users.id, 1)) .returning() .all(); -Expect[], typeof updateAllReturningAllBun>>; +Expect>; const updateGetReturningAll = db.update(users) .set({ @@ -83,7 +82,7 @@ const updateGetReturningAll = db.update(users) .where(eq(users.id, 1)) .returning() .get(); -Expect, typeof updateGetReturningAll>>; +Expect>; const updateGetReturningAllBun = bunDb.update(users) .set({ @@ -93,4 +92,4 @@ const updateGetReturningAllBun = bunDb.update(users) .where(eq(users.id, 1)) .returning() .get(); -Expect, typeof updateGetReturningAllBun>>; +Expect>; diff --git a/drizzle-orm/type-tests/sqlite/with.ts b/drizzle-orm/type-tests/sqlite/with.ts index d738f7f49..db8b33d75 100644 --- a/drizzle-orm/type-tests/sqlite/with.ts +++ b/drizzle-orm/type-tests/sqlite/with.ts @@ -1,9 +1,9 @@ -import type { Equal } from 'type-tests/utils'; -import { Expect } from 'type-tests/utils'; -import { gt, inArray } from '~/expressions'; -import { sql } from '~/sql'; -import { integer, sqliteTable, text } from '~/sqlite-core'; -import { db } from './db'; +import type { Equal } from 'type-tests/utils.ts'; +import { Expect } from 'type-tests/utils.ts'; +import { gt, inArray } from '~/expressions.ts'; +import { sql } from '~/sql/index.ts'; +import { integer, sqliteTable, text } from '~/sqlite-core/index.ts'; +import { db } from './db.ts'; const orders = sqliteTable('orders', { id: integer('id').primaryKey(), diff --git a/drizzle-orm/type-tests/tsconfig.json b/drizzle-orm/type-tests/tsconfig.json index 18f5dee49..449ace992 100644 --- a/drizzle-orm/type-tests/tsconfig.json +++ b/drizzle-orm/type-tests/tsconfig.json @@ -1,6 +1,7 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.build.json", "compilerOptions": { + "composite": false, "module": "esnext", "target": "esnext", "noEmit": true, diff --git a/drizzle-typebox/package.json b/drizzle-typebox/package.json index 077bf40f8..85863c704 100644 --- a/drizzle-typebox/package.json +++ b/drizzle-typebox/package.json @@ -4,7 +4,7 @@ "description": "Generate Typebox schemas from Drizzle ORM schemas", "type": "module", "scripts": { - "build": "rimraf dist && rollup --config rollup.config.ts --configPlugin typescript && resolve-tspaths && cp README.md package.json dist/", + "build": "tsx scripts/build.ts", "b": "pnpm build", "test:types": "cd tests && tsc", "pack": "(cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz", @@ -13,9 +13,15 @@ }, "exports": { ".": { + "import": { + "types": "./index.d.mts", + "default": "./index.mjs" + }, + "require": { + "types": "./index.d.cjs", + "default": "./index.cjs" + }, "types": "./index.d.ts", - "import": "./index.mjs", - "require": "./index.cjs", "default": "./index.mjs" } }, @@ -70,9 +76,11 @@ "@sinclair/typebox": "^0.29.6", "@types/node": "^18.15.10", "ava": "^5.1.0", + "cpy": "^10.1.0", "drizzle-orm": "link:../drizzle-orm/dist", "rimraf": "^5.0.0", "rollup": "^3.20.7", - "tsx": "^3.12.2" + "tsx": "^3.12.2", + "zx": "^7.2.2" } } diff --git a/drizzle-typebox/scripts/build.ts b/drizzle-typebox/scripts/build.ts new file mode 100755 index 000000000..1791a303d --- /dev/null +++ b/drizzle-typebox/scripts/build.ts @@ -0,0 +1,17 @@ +#!/usr/bin/env -S pnpm tsx +import 'zx/globals'; +import cpy from 'cpy'; + +await fs.remove('dist'); +await $`rollup --config rollup.config.ts --configPlugin typescript`; +await $`resolve-tspaths`; +await fs.copy('README.md', 'dist/README.md'); +await Promise.all([ + cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), + }), + cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), + }), +]); +await fs.copy('package.json', 'dist/package.json'); diff --git a/drizzle-typebox/tests/mysql.test.ts b/drizzle-typebox/tests/mysql.test.ts index 2ff12e3ff..f16b39361 100644 --- a/drizzle-typebox/tests/mysql.test.ts +++ b/drizzle-typebox/tests/mysql.test.ts @@ -1,3 +1,5 @@ +import { Type } from '@sinclair/typebox'; +import { Value } from '@sinclair/typebox/value'; import test from 'ava'; import { bigint, @@ -31,8 +33,6 @@ import { } from 'drizzle-orm/mysql-core'; import { createInsertSchema, createSelectSchema, jsonSchema } from '../src'; import { expectSchemaShape } from './utils'; -import { Value } from '@sinclair/typebox/value'; -import { Type } from '@sinclair/typebox'; const customInt = customType<{ data: number }>({ dataType() { @@ -128,15 +128,14 @@ const testTableRow = { }; test('insert valid row', (t) => { - const schema = createInsertSchema(testTable); t.is( Value.Check( schema, - testTableRow - ) , - true + testTableRow, + ), + true, ); }); @@ -147,8 +146,8 @@ test('insert invalid varchar length', (t) => { Value.Check(schema, { ...testTableRow, varchar: 'A'.repeat(201), - }) /* schema.safeParse({ ...testTableRow, varchar: 'A'.repeat(201) }).success */, - false + }), /* schema.safeParse({ ...testTableRow, varchar: 'A'.repeat(201) }).success */ + false, ); }); @@ -173,7 +172,7 @@ test('insert schema', (t) => { binary: Type.String(), boolean: Type.Boolean(), char: Type.String({ minLength: 4, maxLength: 4 }), - charEnum: Type.Union(([Type.Literal('a'), Type.Literal('b'), Type.Literal('c')])), + charEnum: Type.Union([Type.Literal('a'), Type.Literal('b'), Type.Literal('c')]), customInt: Type.Any(), date: Type.Date(), dateString: Type.String(), @@ -221,8 +220,8 @@ test('insert schema', (t) => { timestamp: Type.Date(), timestampString: Type.String(), tinyint: Type.Number(), - varbinary: Type.String({maxLength: 200}), - varchar: Type.String({maxLength: 200}), + varbinary: Type.String({ maxLength: 200 }), + varchar: Type.String({ maxLength: 200 }), varcharEnum: Type.Union([ Type.Literal('a'), Type.Literal('b'), @@ -263,7 +262,7 @@ test('select schema', (t) => { ]), float: Type.Number(), int: Type.Number(), - // + // json: jsonSchema, mediumint: Type.Number(), real: Type.Number(), @@ -297,8 +296,8 @@ test('select schema', (t) => { timestamp: Type.Date(), timestampString: Type.String(), tinyint: Type.Number(), - varbinary: Type.String({maxLength: 200}), - varchar: Type.String({maxLength: 200}), + varbinary: Type.String({ maxLength: 200 }), + varchar: Type.String({ maxLength: 200 }), varcharEnum: Type.Union([ Type.Literal('a'), Type.Literal('b'), @@ -313,16 +312,16 @@ test('select schema', (t) => { test('select schema w/ refine', (t) => { const actual = createSelectSchema(testTable, { - bigint: (_) => Type.BigInt({minimum: 0n}), + bigint: (_) => Type.BigInt({ minimum: 0n }), }); const expected = Type.Object({ - bigint: Type.BigInt({minimum: 0n}), + bigint: Type.BigInt({ minimum: 0n }), bigintNumber: Type.Number(), binary: Type.String(), boolean: Type.Boolean(), char: Type.String({ minLength: 5, maxLength: 5 }), - charEnum: Type.Union(([Type.Literal('a'), Type.Literal('b'), Type.Literal('c')])), + charEnum: Type.Union([Type.Literal('a'), Type.Literal('b'), Type.Literal('c')]), customInt: Type.Any(), date: Type.Date(), dateString: Type.String(), @@ -370,8 +369,8 @@ test('select schema w/ refine', (t) => { timestamp: Type.Date(), timestampString: Type.String(), tinyint: Type.Number(), - varbinary: Type.String({maxLength: 200}), - varchar: Type.String({maxLength: 200}), + varbinary: Type.String({ maxLength: 200 }), + varchar: Type.String({ maxLength: 200 }), varcharEnum: Type.Union([ Type.Literal('a'), Type.Literal('b'), diff --git a/drizzle-typebox/tests/pg.test.ts b/drizzle-typebox/tests/pg.test.ts index 346159521..a9631614b 100644 --- a/drizzle-typebox/tests/pg.test.ts +++ b/drizzle-typebox/tests/pg.test.ts @@ -1,19 +1,9 @@ +import { Type } from '@sinclair/typebox'; +import { Value } from '@sinclair/typebox/value'; import test from 'ava'; -import { - char, - date, - integer, - pgEnum, - pgTable, - serial, - text, - timestamp, - varchar, -} from 'drizzle-orm/pg-core'; -import { Nullable, createInsertSchema, createSelectSchema } from '../src'; +import { char, date, integer, pgEnum, pgTable, serial, text, timestamp, varchar } from 'drizzle-orm/pg-core'; +import { createInsertSchema, createSelectSchema, Nullable } from '../src'; import { expectSchemaShape } from './utils'; -import { Value } from '@sinclair/typebox/value'; -import { Type } from '@sinclair/typebox'; export const roleEnum = pgEnum('role', ['admin', 'user']); @@ -63,7 +53,7 @@ test('users insert invalid varchar', (t) => { ...testUser, profession: 'Chief Executive Officer', }), - false + false, ); }); @@ -84,7 +74,7 @@ test('users insert schema', (t) => { ]), }); - () => { + (() => { { createInsertSchema(users, { // @ts-expect-error (missing property) @@ -98,7 +88,7 @@ test('users insert schema', (t) => { id: 123, }); } - }; + }); const expected = Type.Object({ a: Type.Optional(Nullable(Type.Array(Type.Number()))), @@ -115,7 +105,7 @@ test('users insert schema', (t) => { Type.Literal('admin'), ]), roleText2: Type.Optional( - Type.Union([Type.Literal('admin'), Type.Literal('user')]) + Type.Union([Type.Literal('admin'), Type.Literal('user')]), ), profession: Type.String({ maxLength: 20, minLength: 1 }), initials: Type.String({ maxLength: 2, minLength: 1 }), @@ -138,7 +128,7 @@ test('users insert schema w/ defaults', (t) => { role: Type.Union([Type.Literal('admin'), Type.Literal('user')]), roleText: Type.Union([Type.Literal('admin'), Type.Literal('user')]), roleText2: Type.Optional( - Type.Union([Type.Literal('admin'), Type.Literal('user')]) + Type.Union([Type.Literal('admin'), Type.Literal('user')]), ), profession: Type.String({ maxLength: 20, minLength: 1 }), initials: Type.String({ maxLength: 2, minLength: 1 }), diff --git a/drizzle-typebox/tests/sqlite.test.ts b/drizzle-typebox/tests/sqlite.test.ts index d93212270..9b37b8447 100644 --- a/drizzle-typebox/tests/sqlite.test.ts +++ b/drizzle-typebox/tests/sqlite.test.ts @@ -1,21 +1,9 @@ +import { type Static, Type } from '@sinclair/typebox'; +import { Value } from '@sinclair/typebox/value'; import test from 'ava'; -import { - blob, - integer, - numeric, - real, - sqliteTable, - text, -} from 'drizzle-orm/sqlite-core'; -import { - Nullable, - createInsertSchema, - createSelectSchema, - jsonSchema, -} from '../src'; +import { blob, integer, numeric, real, sqliteTable, text } from 'drizzle-orm/sqlite-core'; +import { createInsertSchema, createSelectSchema, jsonSchema, Nullable } from '../src'; import { expectSchemaShape } from './utils'; -import { Value } from '@sinclair/typebox/value'; -import { type Static, Type } from '@sinclair/typebox'; const blobJsonSchema = Type.Object({ foo: Type.String(), @@ -74,7 +62,7 @@ test('users insert schema', (t) => { ]), }); - () => { + (() => { { createInsertSchema(users, { // @ts-expect-error (missing property) @@ -88,7 +76,7 @@ test('users insert schema', (t) => { id: 123, }); } - }; + }); const expected = Type.Object({ id: Type.Optional(Type.Number({ minimum: 0 })), @@ -105,7 +93,7 @@ test('users insert schema', (t) => { Type.Literal('admin'), Type.Literal('user'), Type.Literal('manager'), - ]) + ]), ), }); @@ -126,7 +114,7 @@ test('users insert schema w/ defaults', (t) => { real: Type.Number(), text: Type.Optional(Nullable(Type.String())), role: Type.Optional( - Type.Union([Type.Literal('admin'), Type.Literal('user')]) + Type.Union([Type.Literal('admin'), Type.Literal('user')]), ), }); @@ -143,7 +131,7 @@ test('users select schema', (t) => { ]), }); - () => { + (() => { { createSelectSchema(users, { // @ts-expect-error (missing property) @@ -157,7 +145,7 @@ test('users select schema', (t) => { id: 123, }); } - }; + }); const expected = Type.Strict( Type.Object({ @@ -175,7 +163,7 @@ test('users select schema', (t) => { Type.Literal('user'), Type.Literal('manager'), ]), - }) + }), ); expectSchemaShape(t, expected).from(actual); diff --git a/drizzle-valibot/package.json b/drizzle-valibot/package.json index b472fd44c..8edb45302 100644 --- a/drizzle-valibot/package.json +++ b/drizzle-valibot/package.json @@ -4,7 +4,7 @@ "description": "Generate valibot schemas from Drizzle ORM schemas", "type": "module", "scripts": { - "build": "rimraf dist && rollup --config rollup.config.ts --configPlugin typescript && resolve-tspaths && cp README.md package.json dist/", + "build": "tsx scripts/build.ts", "b": "pnpm build", "test:types": "cd tests && tsc", "pack": "(cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz", @@ -13,9 +13,15 @@ }, "exports": { ".": { + "import": { + "types": "./index.d.mts", + "default": "./index.mjs" + }, + "require": { + "types": "./index.d.cjs", + "default": "./index.cjs" + }, "types": "./index.d.ts", - "import": "./index.mjs", - "require": "./index.cjs", "default": "./index.mjs" } }, @@ -69,10 +75,12 @@ "@sinclair/typebox": "^0.29.6", "@types/node": "^18.15.10", "ava": "^5.1.0", + "cpy": "^10.1.0", "drizzle-orm": "link:../drizzle-orm/dist", "rimraf": "^5.0.0", "rollup": "^3.20.7", "tsx": "^3.12.2", - "valibot": "^0.12.0" + "valibot": "^0.12.0", + "zx": "^7.2.2" } } diff --git a/drizzle-valibot/scripts/build.ts b/drizzle-valibot/scripts/build.ts new file mode 100755 index 000000000..1791a303d --- /dev/null +++ b/drizzle-valibot/scripts/build.ts @@ -0,0 +1,17 @@ +#!/usr/bin/env -S pnpm tsx +import 'zx/globals'; +import cpy from 'cpy'; + +await fs.remove('dist'); +await $`rollup --config rollup.config.ts --configPlugin typescript`; +await $`resolve-tspaths`; +await fs.copy('README.md', 'dist/README.md'); +await Promise.all([ + cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), + }), + cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), + }), +]); +await fs.copy('package.json', 'dist/package.json'); diff --git a/drizzle-valibot/tests/mysql.test.ts b/drizzle-valibot/tests/mysql.test.ts index 115838fa8..5631aa0c2 100644 --- a/drizzle-valibot/tests/mysql.test.ts +++ b/drizzle-valibot/tests/mysql.test.ts @@ -29,9 +29,23 @@ import { varchar, year, } from 'drizzle-orm/mysql-core'; +import { + any, + bigint as valibigint, + boolean as valiboolean, + date as valiDate, + enumType, + maxLength, + minLength, + minValue, + number, + object, + optional, + parse, + string, +} from 'valibot'; import { createInsertSchema, createSelectSchema, jsonSchema } from '../src'; import { expectSchemaShape } from './utils'; -import { bigint as valibigint, boolean as valiboolean, date as valiDate, object, parse, string, number, minValue, minLength, maxLength, enumType, any, optional } from 'valibot'; const customInt = customType<{ data: number }>({ dataType() { @@ -140,14 +154,14 @@ test('insert invalid varchar length', (t) => { ...testTableRow, varchar: 'A'.repeat(201), }), - undefined /* schema.safeParse({ ...testTableRow, varchar: 'A'.repeat(201) }).success */ + undefined, /* schema.safeParse({ ...testTableRow, varchar: 'A'.repeat(201) }).success */ ); }); test('insert smaller char length should work', (t) => { const schema = createInsertSchema(testTable); - const input = { ...testTableRow, char: 'abc' } + const input = { ...testTableRow, char: 'abc' }; t.deepEqual(parse(schema, input), input); }); @@ -157,7 +171,7 @@ test('insert larger char length should fail', (t) => { t.throws( () => parse(schema, { ...testTableRow, char: 'abcde' }), - undefined + undefined, ); }); diff --git a/drizzle-valibot/tests/pg.test.ts b/drizzle-valibot/tests/pg.test.ts index f596fec62..6b2dbd399 100644 --- a/drizzle-valibot/tests/pg.test.ts +++ b/drizzle-valibot/tests/pg.test.ts @@ -1,19 +1,8 @@ import test from 'ava'; -import { - char, - date, - integer, - pgEnum, - pgTable, - serial, - text, - timestamp, - varchar, -} from 'drizzle-orm/pg-core'; -import { createInsertSchema, createSelectSchema } from '../src'; -import { expectSchemaShape } from './utils'; +import { char, date, integer, pgEnum, pgTable, serial, text, timestamp, varchar } from 'drizzle-orm/pg-core'; import { array, + date as valiDate, email, enumType, maxLength, @@ -25,8 +14,9 @@ import { optional, parse, string, - date as valiDate, } from 'valibot'; +import { createInsertSchema, createSelectSchema } from '../src'; +import { expectSchemaShape } from './utils'; export const roleEnum = pgEnum('role', ['admin', 'user']); @@ -77,7 +67,7 @@ test('users insert invalid varchar', (t) => { ...testUser, profession: 'Chief Executive Officer', }), - undefined + undefined, ); }); @@ -94,7 +84,7 @@ test('users insert schema', (t) => { roleText: enumType(['user', 'manager', 'admin']), }); - () => { + (() => { { createInsertSchema(users, { // @ts-expect-error (missing property) @@ -108,7 +98,7 @@ test('users insert schema', (t) => { id: 123, }); } - }; + }); const expected = object({ a: optional(nullable(array(number()))), @@ -118,9 +108,9 @@ test('users insert schema', (t) => { birthdayString: string(), birthdayDate: valiDate(), createdAt: optional(valiDate()), - role: enumType(['admin','user']), + role: enumType(['admin', 'user']), roleText: enumType(['user', 'manager', 'admin']), - roleText2: optional(enumType([ 'admin', 'user'])), + roleText2: optional(enumType(['admin', 'user'])), profession: string([maxLength(20), minLength(1)]), initials: string([maxLength(2), minLength(1)]), }); @@ -139,9 +129,9 @@ test('users insert schema w/ defaults', (t) => { birthdayString: string(), birthdayDate: valiDate(), createdAt: optional(valiDate()), - role: enumType(['admin','user']), - roleText: enumType(['admin', 'user', ]), - roleText2: optional(enumType([ 'admin', 'user'])), + role: enumType(['admin', 'user']), + roleText: enumType(['admin', 'user']), + roleText2: optional(enumType(['admin', 'user'])), profession: string([maxLength(20), minLength(1)]), initials: string([maxLength(2), minLength(1)]), }); @@ -164,9 +154,9 @@ test('users select schema', (t) => { birthdayString: string(), birthdayDate: valiDate(), createdAt: valiDate(), - role: enumType(['admin', 'user',]), + role: enumType(['admin', 'user']), roleText: enumType(['user', 'manager', 'admin']), - roleText2: enumType(['admin', 'user', ]), + roleText2: enumType(['admin', 'user']), profession: string([maxLength(20), minLength(1)]), initials: string([maxLength(2), minLength(1)]), }); @@ -185,9 +175,9 @@ test('users select schema w/ defaults', (t) => { birthdayString: string(), birthdayDate: valiDate(), createdAt: valiDate(), - role: enumType([ 'admin', 'user',]), - roleText: enumType(['admin', 'user',]), - roleText2: enumType(['admin', 'user',]), + role: enumType(['admin', 'user']), + roleText: enumType(['admin', 'user']), + roleText2: enumType(['admin', 'user']), profession: string([maxLength(20), minLength(1)]), initials: string([maxLength(2), minLength(1)]), }); diff --git a/drizzle-valibot/tests/sqlite.test.ts b/drizzle-valibot/tests/sqlite.test.ts index 300ad9ecd..4b022128a 100644 --- a/drizzle-valibot/tests/sqlite.test.ts +++ b/drizzle-valibot/tests/sqlite.test.ts @@ -1,28 +1,21 @@ import test from 'ava'; +import { blob, integer, numeric, real, sqliteTable, text } from 'drizzle-orm/sqlite-core'; import { - blob, - integer, - numeric, - real, - sqliteTable, - text, -} from 'drizzle-orm/sqlite-core'; -import { createInsertSchema, createSelectSchema, jsonSchema } from '../src'; -import { expectSchemaShape } from './utils'; -import { - type Output, + bigint as valibigint, + boolean, + date as valiDate, enumType, minValue, + nullable, number, object, + optional, + type Output, parse, string, - bigint as valibigint, - date as valiDate, - nullable, - boolean, - optional, } from 'valibot'; +import { createInsertSchema, createSelectSchema, jsonSchema } from '../src'; +import { expectSchemaShape } from './utils'; const blobJsonSchema = object({ foo: string(), @@ -68,7 +61,7 @@ test('users insert invalid text length', (t) => { const schema = createInsertSchema(users); t.throws( () => parse(schema, { ...testUser, text: 'a'.repeat(256) }), - undefined + undefined, ); }); @@ -79,7 +72,7 @@ test('users insert schema', (t) => { role: enumType(['admin', 'user', 'manager']), }); - () => { + (() => { { createInsertSchema(users, { // @ts-expect-error (missing property) @@ -93,7 +86,7 @@ test('users insert schema', (t) => { id: 123, }); } - }; + }); const expected = object({ id: optional(number([minValue(0)])), @@ -136,7 +129,7 @@ test('users select schema', (t) => { role: enumType(['admin', 'user', 'manager']), }); - () => { + (() => { { createSelectSchema(users, { // @ts-expect-error (missing property) @@ -150,7 +143,7 @@ test('users select schema', (t) => { id: 123, }); } - }; + }); const expected = object({ id: number(), diff --git a/drizzle-zod/package.json b/drizzle-zod/package.json index fa208147f..db5e28ad6 100644 --- a/drizzle-zod/package.json +++ b/drizzle-zod/package.json @@ -4,7 +4,7 @@ "description": "Generate Zod schemas from Drizzle ORM schemas", "type": "module", "scripts": { - "build": "rimraf dist && rollup --config rollup.config.ts --configPlugin typescript && resolve-tspaths && cp README.md package.json dist/", + "build": "tsx scripts/build.ts", "b": "pnpm build", "test:types": "cd tests && tsc", "pack": "(cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz", @@ -13,9 +13,15 @@ }, "exports": { ".": { + "import": { + "types": "./index.d.mts", + "default": "./index.mjs" + }, + "require": { + "types": "./index.d.cjs", + "default": "./index.cjs" + }, "types": "./index.d.ts", - "import": "./index.mjs", - "require": "./index.cjs", "default": "./index.mjs" } }, @@ -69,10 +75,12 @@ "@rollup/plugin-typescript": "^11.1.0", "@types/node": "^18.15.10", "ava": "^5.1.0", + "cpy": "^10.1.0", "drizzle-orm": "link:../drizzle-orm/dist", "rimraf": "^5.0.0", "rollup": "^3.20.7", "tsx": "^3.12.2", - "zod": "^3.20.2" + "zod": "^3.20.2", + "zx": "^7.2.2" } } diff --git a/drizzle-zod/scripts/build.ts b/drizzle-zod/scripts/build.ts new file mode 100755 index 000000000..1791a303d --- /dev/null +++ b/drizzle-zod/scripts/build.ts @@ -0,0 +1,17 @@ +#!/usr/bin/env -S pnpm tsx +import 'zx/globals'; +import cpy from 'cpy'; + +await fs.remove('dist'); +await $`rollup --config rollup.config.ts --configPlugin typescript`; +await $`resolve-tspaths`; +await fs.copy('README.md', 'dist/README.md'); +await Promise.all([ + cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), + }), + cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), + }), +]); +await fs.copy('package.json', 'dist/package.json'); diff --git a/drizzle-zod/tests/sqlite.test.ts b/drizzle-zod/tests/sqlite.test.ts index d848555cf..dca127956 100644 --- a/drizzle-zod/tests/sqlite.test.ts +++ b/drizzle-zod/tests/sqlite.test.ts @@ -80,7 +80,6 @@ test('users insert schema', (t) => { real: z.number(), text: z.string().nullable().optional(), role: z.enum(['admin', 'manager', 'user']).optional(), - }); expectSchemaShape(t, expected).from(actual); diff --git a/integration-tests/package.json b/integration-tests/package.json index 358079ecd..d210f127f 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -2,6 +2,7 @@ "name": "integration-tests", "version": "1.0.0", "description": "", + "type": "module", "scripts": { "test:types": "tsc", "test": "ava tests --timeout=60s --serial && pnpm test:esm && pnpm test:rqb", @@ -61,6 +62,8 @@ "dockerode": "^3.3.4", "dotenv": "^16.1.4", "drizzle-zod": "workspace:../drizzle-zod/dist", + "drizzle-typebox": "workspace:../drizzle-typebox/dist", + "drizzle-valibot": "workspace:../drizzle-valibot/dist", "express": "^4.18.2", "get-port": "^7.0.0", "@miniflare/shared": "^2.14.0", diff --git a/integration-tests/tests/better-sqlite.test.ts b/integration-tests/tests/better-sqlite.test.ts index 9c431958c..18f92f21b 100644 --- a/integration-tests/tests/better-sqlite.test.ts +++ b/integration-tests/tests/better-sqlite.test.ts @@ -21,7 +21,7 @@ import { unique, uniqueKeyName, } from 'drizzle-orm/sqlite-core'; -import { Expect } from './utils'; +import { Expect } from './utils.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/d1.test.ts b/integration-tests/tests/d1.test.ts index 28af3f44a..eb71f34e5 100644 --- a/integration-tests/tests/d1.test.ts +++ b/integration-tests/tests/d1.test.ts @@ -16,7 +16,7 @@ import { sqliteView, text, } from 'drizzle-orm/sqlite-core'; -import { Expect } from './utils'; +import { Expect } from './utils.ts'; const usersTable = sqliteTable('users', { id: integer('id').primaryKey(), diff --git a/integration-tests/tests/imports.test.cjs b/integration-tests/tests/imports.test.cjs index 37f649ee8..a4777f055 100644 --- a/integration-tests/tests/imports.test.cjs +++ b/integration-tests/tests/imports.test.cjs @@ -29,7 +29,13 @@ require('drizzle-orm/sqlite-core'); require('drizzle-orm/sqlite-proxy'); require('drizzle-orm/sqlite-proxy/migrator'); require('drizzle-orm/migrator'); -const { createInsertSchema } = require('drizzle-zod'); +const { createInsertSchema: createZodInsertSchema } = require('drizzle-zod'); +const { + createInsertSchema: createTypeboxInsertSchema, +} = require('drizzle-typebox'); +const { + createInsertSchema: createValibotInsertSchema, +} = require('drizzle-valibot'); const { compatibilityVersion, npmVersion } = require('drizzle-orm/version'); const { strict: assert } = require('node:assert'); @@ -40,4 +46,6 @@ const test = pgTable('test', { id: serial('id').primaryKey(), }); -const insertSchema = createInsertSchema(test); +const zodInsertSchema = createZodInsertSchema(test); +const typeboxInsertSchema = createTypeboxInsertSchema(test); +const valibotInsertSchema = createValibotInsertSchema(test); diff --git a/integration-tests/tests/libsql.test.ts b/integration-tests/tests/libsql.test.ts index 6da1473f7..c5a31490b 100644 --- a/integration-tests/tests/libsql.test.ts +++ b/integration-tests/tests/libsql.test.ts @@ -28,7 +28,7 @@ import { sqliteView, text, } from 'drizzle-orm/sqlite-core'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const ENABLE_LOGGING = false; @@ -72,9 +72,9 @@ const courseCategoriesTable = sqliteTable('course_categories', { const orders = sqliteTable('orders', { id: integer('id').primaryKey(), region: text('region').notNull(), - product: text('product').notNull().$default(()=>'random_string'), + product: text('product').notNull().$default(() => 'random_string'), amount: integer('amount').notNull(), - quantity: integer('quantity').notNull() + quantity: integer('quantity').notNull(), }); const usersMigratorTable = sqliteTable('users12', { diff --git a/integration-tests/tests/mysql.prefixed.test.ts b/integration-tests/tests/mysql.prefixed.test.ts index 1987c2d30..e042dd73b 100644 --- a/integration-tests/tests/mysql.prefixed.test.ts +++ b/integration-tests/tests/mysql.prefixed.test.ts @@ -41,7 +41,7 @@ import { migrate } from 'drizzle-orm/mysql2/migrator'; import getPort from 'get-port'; import * as mysql from 'mysql2/promise'; import { v4 as uuid } from 'uuid'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/mysql.test.ts b/integration-tests/tests/mysql.test.ts index 245bc425d..6a747e708 100644 --- a/integration-tests/tests/mysql.test.ts +++ b/integration-tests/tests/mysql.test.ts @@ -43,7 +43,7 @@ import { migrate } from 'drizzle-orm/mysql2/migrator'; import getPort from 'get-port'; import * as mysql from 'mysql2/promise'; import { v4 as uuid } from 'uuid'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/neon-http.test.ts b/integration-tests/tests/neon-http.test.ts index b165fe696..acaa5b0f7 100644 --- a/integration-tests/tests/neon-http.test.ts +++ b/integration-tests/tests/neon-http.test.ts @@ -48,7 +48,7 @@ import { import getPort from 'get-port'; import { Client } from 'pg'; import { v4 as uuid } from 'uuid'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/pg.test.ts b/integration-tests/tests/pg.test.ts index 37687a96e..e26da3bfb 100644 --- a/integration-tests/tests/pg.test.ts +++ b/integration-tests/tests/pg.test.ts @@ -50,12 +50,12 @@ import { import getPort from 'get-port'; import { Client } from 'pg'; import { v4 as uuid } from 'uuid'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const ENABLE_LOGGING = false; const usersTable = pgTable('users', { - id: serial('id').primaryKey(), + id: serial('id' as string).primaryKey(), name: text('name').notNull(), verified: boolean('verified').notNull().default(false), jsonb: jsonb('jsonb').$type(), diff --git a/integration-tests/tests/postgres.js.test.ts b/integration-tests/tests/postgres.js.test.ts index 198c7a8a3..fb657d41b 100644 --- a/integration-tests/tests/postgres.js.test.ts +++ b/integration-tests/tests/postgres.js.test.ts @@ -44,7 +44,7 @@ import { migrate } from 'drizzle-orm/postgres-js/migrator'; import getPort from 'get-port'; import postgres, { type Sql } from 'postgres'; import { v4 as uuid } from 'uuid'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const QUERY_LOGGING = false; diff --git a/integration-tests/tests/relational/bettersqlite.test.ts b/integration-tests/tests/relational/bettersqlite.test.ts index 716b4efbe..6e4bcb750 100644 --- a/integration-tests/tests/relational/bettersqlite.test.ts +++ b/integration-tests/tests/relational/bettersqlite.test.ts @@ -3,7 +3,7 @@ import Database from 'better-sqlite3'; import { desc, DrizzleError, eq, gt, gte, or, placeholder, sql, TransactionRollbackError } from 'drizzle-orm'; import { type BetterSQLite3Database, drizzle } from 'drizzle-orm/better-sqlite3'; import { beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './sqlite.schema'; +import * as schema from './sqlite.schema.ts'; const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; diff --git a/integration-tests/tests/relational/db.ts b/integration-tests/tests/relational/db.ts index 86bd2735c..6cf7db9e0 100644 --- a/integration-tests/tests/relational/db.ts +++ b/integration-tests/tests/relational/db.ts @@ -3,7 +3,7 @@ import Database from 'better-sqlite3'; import { sql } from 'drizzle-orm'; import { drizzle } from 'drizzle-orm/better-sqlite3'; import util from 'node:util'; -import * as schema from './tables'; +import * as schema from './tables.ts'; async function main() { const bdb = new Database(process.env['SQLITE_DB_PATH']!); diff --git a/integration-tests/tests/relational/issues-schemas/duplicates/mysql/mysql.duplicates.test.ts b/integration-tests/tests/relational/issues-schemas/duplicates/mysql/mysql.duplicates.test.ts index db057d6b5..60b178a06 100644 --- a/integration-tests/tests/relational/issues-schemas/duplicates/mysql/mysql.duplicates.test.ts +++ b/integration-tests/tests/relational/issues-schemas/duplicates/mysql/mysql.duplicates.test.ts @@ -6,7 +6,7 @@ import getPort from 'get-port'; import * as mysql from 'mysql2/promise'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './mysql.duplicates'; +import * as schema from './mysql.duplicates.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts b/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts index 0feaabc6c..a28e00c8d 100644 --- a/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts +++ b/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts @@ -6,7 +6,7 @@ import getPort from 'get-port'; import { Client } from 'pg'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './pg.duplicates'; +import * as schema from './pg.duplicates.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts b/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts index e40277b7e..35e2b388f 100644 --- a/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts +++ b/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts @@ -6,7 +6,7 @@ import getPort from 'get-port'; import { Client } from 'pg'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expectTypeOf, test } from 'vitest'; -import * as schema from './pg.schema'; +import * as schema from './pg.schema.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/relational/mysql.planetscale.test.ts b/integration-tests/tests/relational/mysql.planetscale.test.ts index c7fd2dfd0..a87355141 100644 --- a/integration-tests/tests/relational/mysql.planetscale.test.ts +++ b/integration-tests/tests/relational/mysql.planetscale.test.ts @@ -4,7 +4,7 @@ import { connect } from '@planetscale/database'; import { desc, DrizzleError, eq, gt, gte, or, placeholder, sql, TransactionRollbackError } from 'drizzle-orm'; import { drizzle, type PlanetScaleDatabase } from 'drizzle-orm/planetscale-serverless'; import { beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './mysql.schema'; +import * as schema from './mysql.schema.ts'; const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; diff --git a/integration-tests/tests/relational/mysql.test.ts b/integration-tests/tests/relational/mysql.test.ts index 604328e89..b2b526a53 100644 --- a/integration-tests/tests/relational/mysql.test.ts +++ b/integration-tests/tests/relational/mysql.test.ts @@ -6,7 +6,7 @@ import getPort from 'get-port'; import * as mysql from 'mysql2/promise'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './mysql.schema'; +import * as schema from './mysql.schema.ts'; const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; diff --git a/integration-tests/tests/relational/pg.postgresjs.test.ts b/integration-tests/tests/relational/pg.postgresjs.test.ts index b855c286b..bced334dc 100644 --- a/integration-tests/tests/relational/pg.postgresjs.test.ts +++ b/integration-tests/tests/relational/pg.postgresjs.test.ts @@ -6,7 +6,7 @@ import getPort from 'get-port'; import postgres from 'postgres'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './pg.schema'; +import * as schema from './pg.schema.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/relational/pg.test.ts b/integration-tests/tests/relational/pg.test.ts index a5a6fd2a7..ceca76036 100644 --- a/integration-tests/tests/relational/pg.test.ts +++ b/integration-tests/tests/relational/pg.test.ts @@ -6,7 +6,7 @@ import getPort from 'get-port'; import { Client } from 'pg'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './pg.schema'; +import * as schema from './pg.schema.ts'; const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; diff --git a/integration-tests/tests/relational/turso.test.ts b/integration-tests/tests/relational/turso.test.ts index 525a0bc16..d534fb7ee 100644 --- a/integration-tests/tests/relational/turso.test.ts +++ b/integration-tests/tests/relational/turso.test.ts @@ -3,7 +3,7 @@ import { type Client, createClient } from '@libsql/client'; import { desc, DrizzleError, eq, gt, gte, or, placeholder, sql, TransactionRollbackError } from 'drizzle-orm'; import { drizzle, type LibSQLDatabase } from 'drizzle-orm/libsql'; import { beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './sqlite.schema'; +import * as schema from './sqlite.schema.ts'; const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; diff --git a/integration-tests/tests/relational/vercel.test.ts b/integration-tests/tests/relational/vercel.test.ts index 10119ced3..e53356d84 100644 --- a/integration-tests/tests/relational/vercel.test.ts +++ b/integration-tests/tests/relational/vercel.test.ts @@ -6,7 +6,7 @@ import { drizzle, type VercelPgDatabase } from 'drizzle-orm/vercel-postgres'; import getPort from 'get-port'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; -import * as schema from './pg.schema'; +import * as schema from './pg.schema.ts'; const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; diff --git a/integration-tests/tests/sql.js.test.ts b/integration-tests/tests/sql.js.test.ts index 6da546699..38d638fe1 100644 --- a/integration-tests/tests/sql.js.test.ts +++ b/integration-tests/tests/sql.js.test.ts @@ -19,7 +19,7 @@ import { } from 'drizzle-orm/sqlite-core'; import type { Database } from 'sql.js'; import initSqlJs from 'sql.js'; -import { Expect } from './utils'; +import { Expect } from './utils.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tests/vercel-pg.test.ts b/integration-tests/tests/vercel-pg.test.ts index d9d47ef0d..2a02cc98d 100644 --- a/integration-tests/tests/vercel-pg.test.ts +++ b/integration-tests/tests/vercel-pg.test.ts @@ -47,7 +47,7 @@ import { drizzle, type VercelPgDatabase } from 'drizzle-orm/vercel-postgres'; import { migrate } from 'drizzle-orm/vercel-postgres/migrator'; import getPort from 'get-port'; import { v4 as uuid } from 'uuid'; -import { type Equal, Expect } from './utils'; +import { type Equal, Expect } from './utils.ts'; const ENABLE_LOGGING = false; diff --git a/integration-tests/tsconfig.json b/integration-tests/tsconfig.json index 0f5e3e24c..72238c14f 100644 --- a/integration-tests/tsconfig.json +++ b/integration-tests/tsconfig.json @@ -3,10 +3,12 @@ "compilerOptions": { "module": "esnext", "target": "esnext", + "moduleResolution": "NodeNext", + "allowImportingTsExtensions": true, "noEmit": true, "paths": { "~/*": ["./tests/*"] } }, - "include": ["tests"] + "include": ["tests", "type-tests"] } diff --git a/package.json b/package.json index 2bb7bf452..3bbb6b284 100755 --- a/package.json +++ b/package.json @@ -11,30 +11,30 @@ "lint": "eslint --ext ts ." }, "devDependencies": { - "@trivago/prettier-plugin-sort-imports": "^4.1.1", - "@typescript-eslint/eslint-plugin": "^5.59.9", - "@typescript-eslint/experimental-utils": "^5.59.9", - "@typescript-eslint/parser": "^5.59.9", - "bun-types": "^0.6.7", - "concurrently": "^8.1.0", - "dprint": "^0.37.1", - "drizzle-kit": "^0.19.5", + "@trivago/prettier-plugin-sort-imports": "^4.2.0", + "@typescript-eslint/eslint-plugin": "^6.4.1", + "@typescript-eslint/experimental-utils": "^5.62.0", + "@typescript-eslint/parser": "^6.4.1", + "bun-types": "^0.7.3", + "concurrently": "^8.2.1", + "dprint": "^0.40.2", + "drizzle-kit": "^0.19.13", "drizzle-orm": "workspace:./drizzle-orm/dist", "drizzle-orm-old": "npm:drizzle-orm@^0.27.2", - "eslint": "^8.42.0", + "eslint": "^8.47.0", "eslint-plugin-drizzle": "link:eslint/eslint-plugin-drizzle", - "eslint-plugin-import": "^2.27.5", + "eslint-plugin-import": "^2.28.1", "eslint-plugin-no-instanceof": "^1.0.1", - "eslint-plugin-unicorn": "^47.0.0", - "eslint-plugin-unused-imports": "^2.0.0", - "prettier": "^2.8.8", - "resolve-tspaths": "^0.8.13", - "turbo": "^1.10.1", - "typescript": "5.1.3" + "eslint-plugin-unicorn": "^48.0.1", + "eslint-plugin-unused-imports": "^3.0.0", + "prettier": "^3.0.2", + "resolve-tspaths": "^0.8.15", + "turbo": "^1.10.13", + "typescript": "5.1.6" }, "pnpm": { "patchedDependencies": { - "typescript@5.1.3": "patches/typescript@5.1.3.patch" + "typescript@5.1.6": "patches/typescript@5.1.6.patch" } } } diff --git a/patches/typescript@5.1.3.patch b/patches/typescript@5.1.6.patch similarity index 83% rename from patches/typescript@5.1.3.patch rename to patches/typescript@5.1.6.patch index 025a3be92..0af94f800 100644 --- a/patches/typescript@5.1.3.patch +++ b/patches/typescript@5.1.6.patch @@ -1,5 +1,5 @@ diff --git a/lib/tsserver.js b/lib/tsserver.js -index 63bcdac309ff42bedada2d018b795be57ee2fe8d..cd9dd67c5a593b9dc721b3d861eb178227ddd6a6 100644 +index 2329a12e68fc1788ad518eef084b69767f0e1a6c..9044051c1457ac05d13c9a16ddc7a8f9dc9d3640 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -14987,7 +14987,7 @@ function isRestParameter(node) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6fd5cf285..d22f436fe 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,74 +5,74 @@ settings: excludeLinksFromLockfile: false patchedDependencies: - typescript@5.1.3: - hash: aeulzlcp5mwpqivdtylujgnyli - path: patches/typescript@5.1.3.patch + typescript@5.1.6: + hash: nqltnu2tftypeoe37zeioxuuuq + path: patches/typescript@5.1.6.patch importers: .: devDependencies: '@trivago/prettier-plugin-sort-imports': - specifier: ^4.1.1 - version: 4.1.1(prettier@2.8.8) + specifier: ^4.2.0 + version: 4.2.0(prettier@3.0.2) '@typescript-eslint/eslint-plugin': - specifier: ^5.59.9 - version: 5.59.9(@typescript-eslint/parser@5.59.9)(eslint@8.42.0)(typescript@5.1.3) + specifier: ^6.4.1 + version: 6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6) '@typescript-eslint/experimental-utils': - specifier: ^5.59.9 - version: 5.59.9(eslint@8.42.0)(typescript@5.1.3) + specifier: ^5.62.0 + version: 5.62.0(eslint@8.47.0)(typescript@5.1.6) '@typescript-eslint/parser': - specifier: ^5.59.9 - version: 5.59.9(eslint@8.42.0)(typescript@5.1.3) + specifier: ^6.4.1 + version: 6.4.1(eslint@8.47.0)(typescript@5.1.6) bun-types: - specifier: ^0.6.7 - version: 0.6.7 + specifier: ^0.7.3 + version: 0.7.3 concurrently: - specifier: ^8.1.0 - version: 8.1.0 + specifier: ^8.2.1 + version: 8.2.1 dprint: - specifier: ^0.37.1 - version: 0.37.1 + specifier: ^0.40.2 + version: 0.40.2 drizzle-kit: - specifier: ^0.19.5 - version: 0.19.5 + specifier: ^0.19.13 + version: 0.19.13 drizzle-orm: specifier: workspace:./drizzle-orm/dist version: link:drizzle-orm/dist drizzle-orm-old: specifier: npm:drizzle-orm@^0.27.2 - version: /drizzle-orm@0.27.2(bun-types@0.6.7) + version: /drizzle-orm@0.27.2(bun-types@0.7.3) eslint: - specifier: ^8.42.0 - version: 8.42.0 + specifier: ^8.47.0 + version: 8.47.0 eslint-plugin-drizzle: specifier: link:eslint/eslint-plugin-drizzle version: link:eslint/eslint-plugin-drizzle eslint-plugin-import: - specifier: ^2.27.5 - version: 2.27.5(@typescript-eslint/parser@5.59.9)(eslint@8.42.0) + specifier: ^2.28.1 + version: 2.28.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0) eslint-plugin-no-instanceof: specifier: ^1.0.1 version: 1.0.1 eslint-plugin-unicorn: - specifier: ^47.0.0 - version: 47.0.0(eslint@8.42.0) + specifier: ^48.0.1 + version: 48.0.1(eslint@8.47.0) eslint-plugin-unused-imports: - specifier: ^2.0.0 - version: 2.0.0(@typescript-eslint/eslint-plugin@5.59.9)(eslint@8.42.0) + specifier: ^3.0.0 + version: 3.0.0(@typescript-eslint/eslint-plugin@6.4.1)(eslint@8.47.0) prettier: - specifier: ^2.8.8 - version: 2.8.8 + specifier: ^3.0.2 + version: 3.0.2 resolve-tspaths: - specifier: ^0.8.13 - version: 0.8.13(typescript@5.1.3) + specifier: ^0.8.15 + version: 0.8.15(typescript@5.1.6) turbo: - specifier: ^1.10.1 - version: 1.10.1 + specifier: ^1.10.13 + version: 1.10.13 typescript: - specifier: 5.1.3 - version: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + specifier: 5.1.6 + version: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) drizzle-orm: devDependencies: @@ -105,7 +105,7 @@ importers: version: 5.0.2(rollup@3.27.2) '@rollup/plugin-typescript': specifier: ^11.1.1 - version: 11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.3) + version: 11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.6) '@types/better-sqlite3': specifier: ^7.6.4 version: 7.6.4 @@ -130,6 +130,9 @@ importers: concurrently: specifier: ^8.1.0 version: 8.1.0 + cpy: + specifier: ^10.1.0 + version: 10.1.0 cpy-cli: specifier: ^5.0.0 version: 5.0.0 @@ -156,7 +159,10 @@ importers: version: 3.27.2 rollup-plugin-dts: specifier: ^5.3.1 - version: 5.3.1(rollup@3.27.2)(typescript@5.1.3) + version: 5.3.1(rollup@3.27.2)(typescript@5.1.6) + rollup-plugin-typescript2: + specifier: ^0.35.0 + version: 0.35.0(rollup@3.27.2)(typescript@5.1.6) sql.js: specifier: ^1.8.0 version: 1.8.0 @@ -171,7 +177,7 @@ importers: version: 3.12.7 vite-tsconfig-paths: specifier: ^4.2.0 - version: 4.2.0(typescript@5.1.3)(vite@4.3.9) + version: 4.2.0(typescript@5.1.6)(vite@4.3.9) vitest: specifier: ^0.31.4 version: 0.31.4(@vitest/ui@0.31.4) @@ -189,7 +195,7 @@ importers: version: 0.4.1(rollup@3.27.2) '@rollup/plugin-typescript': specifier: ^11.1.0 - version: 11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.3) + version: 11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.6) '@sinclair/typebox': specifier: ^0.29.6 version: 0.29.6 @@ -199,6 +205,9 @@ importers: ava: specifier: ^5.1.0 version: 5.3.0 + cpy: + specifier: ^10.1.0 + version: 10.1.0 drizzle-orm: specifier: link:../drizzle-orm/dist version: link:../drizzle-orm/dist @@ -211,6 +220,9 @@ importers: tsx: specifier: ^3.12.2 version: 3.12.7 + zx: + specifier: ^7.2.2 + version: 7.2.2 drizzle-valibot: devDependencies: @@ -219,7 +231,7 @@ importers: version: 0.4.1(rollup@3.27.2) '@rollup/plugin-typescript': specifier: ^11.1.0 - version: 11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.3) + version: 11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.6) '@sinclair/typebox': specifier: ^0.29.6 version: 0.29.6 @@ -229,6 +241,9 @@ importers: ava: specifier: ^5.1.0 version: 5.3.0 + cpy: + specifier: ^10.1.0 + version: 10.1.0 drizzle-orm: specifier: link:../drizzle-orm/dist version: link:../drizzle-orm/dist @@ -244,6 +259,9 @@ importers: valibot: specifier: ^0.12.0 version: 0.12.0 + zx: + specifier: ^7.2.2 + version: 7.2.2 drizzle-zod: devDependencies: @@ -252,13 +270,16 @@ importers: version: 0.4.1(rollup@3.20.7) '@rollup/plugin-typescript': specifier: ^11.1.0 - version: 11.1.0(rollup@3.20.7)(typescript@5.1.3) + version: 11.1.0(rollup@3.20.7)(typescript@5.1.6) '@types/node': specifier: ^18.15.10 version: 18.15.10 ava: specifier: ^5.1.0 version: 5.2.0 + cpy: + specifier: ^10.1.0 + version: 10.1.0 drizzle-orm: specifier: link:../drizzle-orm/dist version: link:../drizzle-orm/dist @@ -274,6 +295,9 @@ importers: zod: specifier: ^3.20.2 version: 3.21.4 + zx: + specifier: ^7.2.2 + version: 7.2.2 integration-tests: dependencies: @@ -310,6 +334,12 @@ importers: dotenv: specifier: ^16.1.4 version: 16.1.4 + drizzle-typebox: + specifier: workspace:../drizzle-typebox/dist + version: link:../drizzle-typebox/dist + drizzle-valibot: + specifier: workspace:../drizzle-valibot/dist + version: link:../drizzle-valibot/dist drizzle-zod: specifier: workspace:../drizzle-zod/dist version: link:../drizzle-zod/dist @@ -397,10 +427,15 @@ importers: version: 4.3.9(@types/node@20.2.5) vite-tsconfig-paths: specifier: ^4.2.0 - version: 4.2.0(typescript@5.1.3)(vite@4.3.9) + version: 4.2.0(typescript@5.1.6)(vite@4.3.9) packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + /@aws-crypto/crc32@3.0.0: resolution: {integrity: sha512-IzSgsrxUcsrejQbPVilIKy16kAT52EwB6zSaI+M3xxIhKh5+aldEyvI+z6erM7TCLB2BJsFrtHjp6/4/sr+3dA==} dependencies: @@ -449,7 +484,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/client-cognito-identity@3.345.0: resolution: {integrity: sha512-KHpJ7jZq0OGXNIJ+K0U4DcVubroXq92TD7rQi16TU7q8AnjrCoMuJz32QJI+9FEFbjmTIJ/tts9rma0PqR30bw==} @@ -619,7 +654,7 @@ packages: '@aws-sdk/util-utf8': 3.310.0 '@smithy/protocol-http': 1.0.1 '@smithy/types': 1.0.0 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -701,7 +736,7 @@ packages: '@aws-sdk/util-utf8': 3.310.0 '@smithy/protocol-http': 1.0.1 '@smithy/types': 1.0.0 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -787,7 +822,7 @@ packages: '@smithy/protocol-http': 1.0.1 '@smithy/types': 1.0.0 fast-xml-parser: 4.1.2 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -888,7 +923,7 @@ packages: '@aws-sdk/property-provider': 3.342.0 '@aws-sdk/shared-ini-file-loader': 3.342.0 '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -923,7 +958,7 @@ packages: '@aws-sdk/property-provider': 3.342.0 '@aws-sdk/shared-ini-file-loader': 3.342.0 '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -964,7 +999,7 @@ packages: '@aws-sdk/shared-ini-file-loader': 3.342.0 '@aws-sdk/token-providers': 3.344.0 '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -1019,7 +1054,7 @@ packages: '@aws-crypto/crc32': 3.0.0 '@aws-sdk/types': 3.342.0 '@aws-sdk/util-hex-encoding': 3.310.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/fetch-http-handler@3.342.0: resolution: {integrity: sha512-zsC23VUQMHEu4OKloLCVyWLG0ns6n+HKZ9euGLnNO3l0VSRne9qj/94yR+4jr/h04M7MhGf9mlczGfnZUFxs5w==} @@ -1049,7 +1084,7 @@ packages: resolution: {integrity: sha512-urnbcCR+h9NWUnmOtet/s4ghvzsidFmspfhYaHAmSRdy9yDjdjBJMFjjsn85A1ODUktztm+cVncXjQ38WCMjMQ==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/middleware-content-length@3.342.0: resolution: {integrity: sha512-7LUMZqhihSAptGRFFQvuwt9nCLNzNPkGd1oU1RpVXw6YPQfKP9Ec5tgg4oUlv1t58IYQvdVj5ITKp4X2aUJVPg==} @@ -1110,7 +1145,7 @@ packages: dependencies: '@aws-sdk/middleware-signing': 3.342.0 '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/middleware-serde@3.342.0: resolution: {integrity: sha512-WRD+Cyu6+h1ymfPnAw4fI2q3zXjihJ55HFe1uRF8VPN4uBbJNfN3IqL38y/SMEdZ0gH9zNlRNxZLhR0q6SNZEQ==} @@ -1143,7 +1178,7 @@ packages: '@aws-sdk/protocol-http': 3.342.0 '@aws-sdk/types': 3.342.0 '@aws-sdk/util-endpoints': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 dev: true /@aws-sdk/middleware-user-agent@3.345.0: @@ -1187,7 +1222,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/querystring-builder@3.342.0: resolution: {integrity: sha512-tb3FbtC36a7XBYeupdKm60LeM0etp73I6/7pDAkzAlw7zJdvY0aQIvj1c0U6nZlwZF8sSSxC7vlamR+wCspdMw==} @@ -1195,14 +1230,14 @@ packages: dependencies: '@aws-sdk/types': 3.342.0 '@aws-sdk/util-uri-escape': 3.310.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/querystring-parser@3.342.0: resolution: {integrity: sha512-6svvr/LZW1EPJaARnOpjf92FIiK25wuO7fRq05gLTcTRAfUMDvub+oDg3Ro9EjJERumrYQrYCem5Qi4X9w8K2g==} engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/service-error-classification@3.342.0: resolution: {integrity: sha512-MwHO5McbdAVKxfQj1yhleboAXqrzcGoi9ODS+bwCwRfe2lakGzBBhu8zaGDlKYOdv5rS+yAPP/5fZZUiuZY8Bw==} @@ -1226,7 +1261,7 @@ packages: '@aws-sdk/util-middleware': 3.342.0 '@aws-sdk/util-uri-escape': 3.310.0 '@aws-sdk/util-utf8': 3.310.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/smithy-client@3.342.0: resolution: {integrity: sha512-HQ4JejjHU2X7OAZPwixFG+EyPSjmoZqll7EvWjPSKyclWrM320haWWz1trVzjG/AgPfeDLfRkH/JoMr13lECew==} @@ -1244,7 +1279,7 @@ packages: '@aws-sdk/property-provider': 3.342.0 '@aws-sdk/shared-ini-file-loader': 3.342.0 '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 transitivePeerDependencies: - aws-crt dev: true @@ -1298,13 +1333,13 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@aws-sdk/is-array-buffer': 3.310.0 - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-config-provider@3.310.0: resolution: {integrity: sha512-xIBaYo8dwiojCw8vnUcIL4Z5tyfb1v3yjqyJKJWV/dqKUFOOS0U591plmXbM+M/QkXyML3ypon1f8+BoaDExrg==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-defaults-mode-browser@3.342.0: resolution: {integrity: sha512-N1ZRvCLbrt4Re9MKU3pLYR0iO+H7GU7RsXG4yAq6DtSWT9WCw6xhIUpeV2T5uxWKL92o3WHNiGjwcebq+N73Bg==} @@ -1337,19 +1372,19 @@ packages: resolution: {integrity: sha512-sVN7mcCCDSJ67pI1ZMtk84SKGqyix6/0A1Ab163YKn+lFBQRMKexleZzpYzNGxYzmQS6VanP/cfU7NiLQOaSfA==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-locate-window@3.310.0: resolution: {integrity: sha512-qo2t/vBTnoXpjKxlsC2e1gBrRm80M3bId27r0BRB2VniSSe7bL1mmzM+/HFtujm0iAxtPM+aLEflLJlJeDPg0w==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-middleware@3.342.0: resolution: {integrity: sha512-P2LYyMP4JUFZBy9DcMvCDxWU34mlShCyrqBZ1ouuGW7UMgRb1PTEvpLAVndIWn9H+1KGDFjMqOWp1FZHr4YZOA==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-retry@3.342.0: resolution: {integrity: sha512-U1LXXtOMAQjU4H9gjYZng8auRponAH0t3vShHMKT8UQggT6Hwz1obdXUZgcLCtcjp/1aEK4MkDwk2JSjuUTaZw==} @@ -1362,14 +1397,14 @@ packages: resolution: {integrity: sha512-drzt+aB2qo2LgtDoiy/3sVG8w63cgLkqFIa2NFlGpUgHFWTXkqtbgf4L5QdjRGKWhmZsnqkbtL7vkSWEcYDJ4Q==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-user-agent-browser@3.342.0: resolution: {integrity: sha512-FWHiBi1xaebzmq3LJsizgd2LCix/bKHUTOjTeO6hEYny5DyrOl0liwIA0mqgvfgwIoMOF/l6FGg7kTfKtNgkEA==} dependencies: '@aws-sdk/types': 3.342.0 bowser: 2.11.0 - tslib: 2.5.2 + tslib: 2.5.3 dev: true /@aws-sdk/util-user-agent-browser@3.345.0: @@ -1391,7 +1426,7 @@ packages: dependencies: '@aws-sdk/node-config-provider': 3.342.0 '@aws-sdk/types': 3.342.0 - tslib: 2.5.2 + tslib: 2.5.3 dev: true /@aws-sdk/util-user-agent-node@3.345.0: @@ -1411,7 +1446,7 @@ packages: /@aws-sdk/util-utf8-browser@3.259.0: resolution: {integrity: sha512-UvFa/vR+e19XookZF8RzFZBrw2EUkQWxiBW0yYQAhvk3C+QVGl0H3ouca8LDBlBfQKXwmW3huo/59H8rwb1wJw==} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@aws-sdk/util-utf8@3.310.0: resolution: {integrity: sha512-DnLfFT8uCO22uOJc0pt0DsSNau1GTisngBCDw8jQuWT5CqogMJu4b/uXmwEqfj8B3GX6Xsz8zOd6JpRlPftQoA==} @@ -1420,67 +1455,53 @@ packages: '@aws-sdk/util-buffer-from': 3.310.0 tslib: 2.5.3 - /@babel/code-frame@7.22.5: - resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} + /@babel/code-frame@7.22.10: + resolution: {integrity: sha512-/KKIMG4UEL35WmI9OlvMhurwtytjvXoFcGNrOvyG9zIzA8YmPjVtIZUf7b05+TPO7G7/GEmLHDaoCgACHl9hhA==} engines: {node: '>=6.9.0'} requiresBuild: true dependencies: - '@babel/highlight': 7.22.5 + '@babel/highlight': 7.22.10 + chalk: 2.4.2 dev: true /@babel/generator@7.17.7: resolution: {integrity: sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.17.0 jsesc: 2.5.2 source-map: 0.5.7 dev: true - /@babel/generator@7.22.3: - resolution: {integrity: sha512-C17MW4wlk//ES/CJDL51kPNwl+qiBQyN7b9SKyVp11BLGFeSPoVaHrv+MNt8jwQFhQWowW88z1eeBx3pFz9v8A==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.4 - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.18 - jsesc: 2.5.2 - dev: true - - /@babel/helper-environment-visitor@7.22.1: - resolution: {integrity: sha512-Z2tgopurB/kTbidvzeBrc2To3PUP/9i5MUe+fU6QJCQDyPwSH2oRapkLw3KGECDYSjhQZCNxEvNvZlLw8JjGwA==} + /@babel/helper-environment-visitor@7.22.5: + resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name@7.21.0: - resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} + /@babel/helper-function-name@7.22.5: + resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.21.9 - '@babel/types': 7.22.4 + '@babel/template': 7.22.5 + '@babel/types': 7.22.10 dev: true - /@babel/helper-hoist-variables@7.18.6: - resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + /@babel/helper-hoist-variables@7.22.5: + resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.10 dev: true - /@babel/helper-split-export-declaration@7.18.6: - resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.10 dev: true - /@babel/helper-string-parser@7.21.5: - resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} - engines: {node: '>=6.9.0'} - dev: true - - /@babel/helper-validator-identifier@7.19.1: - resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + /@babel/helper-string-parser@7.22.5: + resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} engines: {node: '>=6.9.0'} dev: true @@ -1490,60 +1511,51 @@ packages: requiresBuild: true dev: true - /@babel/highlight@7.22.5: - resolution: {integrity: sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==} + /@babel/highlight@7.22.10: + resolution: {integrity: sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==} engines: {node: '>=6.9.0'} - requiresBuild: true dependencies: '@babel/helper-validator-identifier': 7.22.5 chalk: 2.4.2 js-tokens: 4.0.0 dev: true - /@babel/parser@7.21.2: - resolution: {integrity: sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==} - engines: {node: '>=6.0.0'} - hasBin: true - dependencies: - '@babel/types': 7.22.4 - dev: true - - /@babel/parser@7.22.4: - resolution: {integrity: sha512-VLLsx06XkEYqBtE5YGPwfSGwfrjnyPP5oiGty3S8pQLFDFLaS8VwWSIxkTXpcvr5zeYLE6+MBNl2npl/YnfofA==} + /@babel/parser@7.22.10: + resolution: {integrity: sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.17.0 dev: true - /@babel/runtime@7.22.3: - resolution: {integrity: sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==} + /@babel/runtime@7.22.10: + resolution: {integrity: sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==} engines: {node: '>=6.9.0'} dependencies: - regenerator-runtime: 0.13.11 + regenerator-runtime: 0.14.0 dev: true - /@babel/template@7.21.9: - resolution: {integrity: sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==} + /@babel/template@7.22.5: + resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 - '@babel/parser': 7.22.4 - '@babel/types': 7.22.4 + '@babel/code-frame': 7.22.10 + '@babel/parser': 7.22.10 + '@babel/types': 7.22.10 dev: true /@babel/traverse@7.17.3: resolution: {integrity: sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.5 - '@babel/generator': 7.22.3 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.22.4 - '@babel/types': 7.22.4 + '@babel/code-frame': 7.22.10 + '@babel/generator': 7.17.7 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-hoist-variables': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + '@babel/parser': 7.22.10 + '@babel/types': 7.17.0 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -1558,11 +1570,11 @@ packages: to-fast-properties: 2.0.0 dev: true - /@babel/types@7.22.4: - resolution: {integrity: sha512-Tx9x3UBHTTsMSW85WB2kphxYQVvrZ/t1FxD88IpSgIjiUJlCm9z+xWIDwyo1vffTwSqteqyznB8ZE9vYYk16zA==} + /@babel/types@7.22.10: + resolution: {integrity: sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.21.5 + '@babel/helper-string-parser': 7.22.5 '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 dev: true @@ -1575,8 +1587,56 @@ packages: resolution: {integrity: sha512-A0w1V+5SUawGaaPRlhFhSC/SCDT9oQG8TMoWOKFLA4qbqagELqEAFD4KySBIkeVOvCBLT1DZSYBMCxbXddl0kw==} dev: true - /@drizzle-team/studio@0.0.1: - resolution: {integrity: sha512-cHgGezy2ojBFMaU6PZyBkksgFsg2CQ8IRN4mS7WdbA/Zv6xUK6fCNmpEWS/FftbxoA4B8Z0XGnuKsaTJEZsGgA==} + /@dprint/darwin-arm64@0.40.2: + resolution: {integrity: sha512-qharMFhxpNq9brgvHLbqzzAgVgPWSHLfzNLwWWhKcGOUUDUIilfAo3SlvOz6w4nQiIifLpYZOvZqK7Lpf9mSSw==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@dprint/darwin-x64@0.40.2: + resolution: {integrity: sha512-FPDdOTVr1JfqtLBTCvqlihWslTy3LBUoi3H1gaqIazCKMj2dB9voFWkBiMT+REMHDrlVsoSpFAfsliNr/y7HPA==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@dprint/linux-arm64-glibc@0.40.2: + resolution: {integrity: sha512-GmUWfKwEwXA+onvewX9hEJSMcd9V184+uRbEhI5tG28tBP9+IjQhrY7jCjxPvaZA+EvzNPnAy5D1wbJdlNLBNA==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@dprint/linux-x64-glibc@0.40.2: + resolution: {integrity: sha512-vMHAHdsOY+2thieSWbIrIioDfPgvipwUgd0MZUWOqycTrXU6kLyi2B+5J/2Jc+QO3CiLIbumQd2FH/0vB1eWqA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@dprint/linux-x64-musl@0.40.2: + resolution: {integrity: sha512-nFSbDWd9ORyOhJ7a+RmE39WbuPoQ3OQutIgfAmfikiu/wENzEwxxv4QJ7aFnBaoZb0wuVEEpXShr8vY4p0exkg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@dprint/win32-x64@0.40.2: + resolution: {integrity: sha512-qF4VCQzFTZYD61lbQqXLU/IwUTbLK22CancO+uVtXmZRoKU9GaVjcBhMUB7URxsa8rvxWHhHT6ldillI/aOWCg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@drizzle-team/studio@0.0.5: + resolution: {integrity: sha512-ps5qF0tMxWRVu+V5gvCRrQNqlY92aTnIKdq27gm9LZMSdaKYZt6AVvSK1dlUMzs6Rt0Jm80b+eWct6xShBKhIw==} dev: true /@esbuild-kit/cjs-loader@2.4.2: @@ -1608,8 +1668,8 @@ packages: requiresBuild: true optional: true - /@esbuild/android-arm64@0.18.13: - resolution: {integrity: sha512-j7NhycJUoUAG5kAzGf4fPWfd17N6SM3o1X6MlXVqfHvs2buFraCJzos9vbeWjLxOyBKHyPOnuCuipbhvbYtTAg==} + /@esbuild/android-arm64@0.18.20: + resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1625,8 +1685,8 @@ packages: requiresBuild: true optional: true - /@esbuild/android-arm@0.18.13: - resolution: {integrity: sha512-KwqFhxRFMKZINHzCqf8eKxE0XqWlAVPRxwy6rc7CbVFxzUWB2sA/s3hbMZeemPdhN3fKBkqOaFhTbS8xJXYIWQ==} + /@esbuild/android-arm@0.18.20: + resolution: {integrity: sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1642,8 +1702,8 @@ packages: requiresBuild: true optional: true - /@esbuild/android-x64@0.18.13: - resolution: {integrity: sha512-M2eZkRxR6WnWfVELHmv6MUoHbOqnzoTVSIxgtsyhm/NsgmL+uTmag/VVzdXvmahak1I6sOb1K/2movco5ikDJg==} + /@esbuild/android-x64@0.18.20: + resolution: {integrity: sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1659,8 +1719,8 @@ packages: requiresBuild: true optional: true - /@esbuild/darwin-arm64@0.18.13: - resolution: {integrity: sha512-f5goG30YgR1GU+fxtaBRdSW3SBG9pZW834Mmhxa6terzcboz7P2R0k4lDxlkP7NYRIIdBbWp+VgwQbmMH4yV7w==} + /@esbuild/darwin-arm64@0.18.20: + resolution: {integrity: sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1676,8 +1736,8 @@ packages: requiresBuild: true optional: true - /@esbuild/darwin-x64@0.18.13: - resolution: {integrity: sha512-RIrxoKH5Eo+yE5BtaAIMZaiKutPhZjw+j0OCh8WdvKEKJQteacq0myZvBDLU+hOzQOZWJeDnuQ2xgSScKf1Ovw==} + /@esbuild/darwin-x64@0.18.20: + resolution: {integrity: sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1693,8 +1753,8 @@ packages: requiresBuild: true optional: true - /@esbuild/freebsd-arm64@0.18.13: - resolution: {integrity: sha512-AfRPhHWmj9jGyLgW/2FkYERKmYR+IjYxf2rtSLmhOrPGFh0KCETFzSjx/JX/HJnvIqHt/DRQD/KAaVsUKoI3Xg==} + /@esbuild/freebsd-arm64@0.18.20: + resolution: {integrity: sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1710,8 +1770,8 @@ packages: requiresBuild: true optional: true - /@esbuild/freebsd-x64@0.18.13: - resolution: {integrity: sha512-pGzWWZJBInhIgdEwzn8VHUBang8UvFKsvjDkeJ2oyY5gZtAM6BaxK0QLCuZY+qoj/nx/lIaItH425rm/hloETA==} + /@esbuild/freebsd-x64@0.18.20: + resolution: {integrity: sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1727,8 +1787,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-arm64@0.18.13: - resolution: {integrity: sha512-hCzZbVJEHV7QM77fHPv2qgBcWxgglGFGCxk6KfQx6PsVIdi1u09X7IvgE9QKqm38OpkzaAkPnnPqwRsltvLkIQ==} + /@esbuild/linux-arm64@0.18.20: + resolution: {integrity: sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1744,8 +1804,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-arm@0.18.13: - resolution: {integrity: sha512-4iMxLRMCxGyk7lEvkkvrxw4aJeC93YIIrfbBlUJ062kilUUnAiMb81eEkVvCVoh3ON283ans7+OQkuy1uHW+Hw==} + /@esbuild/linux-arm@0.18.20: + resolution: {integrity: sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1761,8 +1821,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-ia32@0.18.13: - resolution: {integrity: sha512-I3OKGbynl3AAIO6onXNrup/ttToE6Rv2XYfFgLK/wnr2J+1g+7k4asLrE+n7VMhaqX+BUnyWkCu27rl+62Adug==} + /@esbuild/linux-ia32@0.18.20: + resolution: {integrity: sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1787,8 +1847,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-loong64@0.18.13: - resolution: {integrity: sha512-8pcKDApAsKc6WW51ZEVidSGwGbebYw2qKnO1VyD8xd6JN0RN6EUXfhXmDk9Vc4/U3Y4AoFTexQewQDJGsBXBpg==} + /@esbuild/linux-loong64@0.18.20: + resolution: {integrity: sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -1804,8 +1864,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-mips64el@0.18.13: - resolution: {integrity: sha512-6GU+J1PLiVqWx8yoCK4Z0GnfKyCGIH5L2KQipxOtbNPBs+qNDcMJr9euxnyJ6FkRPyMwaSkjejzPSISD9hb+gg==} + /@esbuild/linux-mips64el@0.18.20: + resolution: {integrity: sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1821,8 +1881,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-ppc64@0.18.13: - resolution: {integrity: sha512-pfn/OGZ8tyR8YCV7MlLl5hAit2cmS+j/ZZg9DdH0uxdCoJpV7+5DbuXrR+es4ayRVKIcfS9TTMCs60vqQDmh+w==} + /@esbuild/linux-ppc64@0.18.20: + resolution: {integrity: sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1838,8 +1898,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-riscv64@0.18.13: - resolution: {integrity: sha512-aIbhU3LPg0lOSCfVeGHbmGYIqOtW6+yzO+Nfv57YblEK01oj0mFMtvDJlOaeAZ6z0FZ9D13oahi5aIl9JFphGg==} + /@esbuild/linux-riscv64@0.18.20: + resolution: {integrity: sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1855,8 +1915,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-s390x@0.18.13: - resolution: {integrity: sha512-Pct1QwF2sp+5LVi4Iu5Y+6JsGaV2Z2vm4O9Dd7XZ5tKYxEHjFtb140fiMcl5HM1iuv6xXO8O1Vrb1iJxHlv8UA==} + /@esbuild/linux-s390x@0.18.20: + resolution: {integrity: sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1872,8 +1932,8 @@ packages: requiresBuild: true optional: true - /@esbuild/linux-x64@0.18.13: - resolution: {integrity: sha512-zTrIP0KzYP7O0+3ZnmzvUKgGtUvf4+piY8PIO3V8/GfmVd3ZyHJGz7Ht0np3P1wz+I8qJ4rjwJKqqEAbIEPngA==} + /@esbuild/linux-x64@0.18.20: + resolution: {integrity: sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1889,8 +1949,8 @@ packages: requiresBuild: true optional: true - /@esbuild/netbsd-x64@0.18.13: - resolution: {integrity: sha512-I6zs10TZeaHDYoGxENuksxE1sxqZpCp+agYeW039yqFwh3MgVvdmXL5NMveImOC6AtpLvE4xG5ujVic4NWFIDQ==} + /@esbuild/netbsd-x64@0.18.20: + resolution: {integrity: sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1906,8 +1966,8 @@ packages: requiresBuild: true optional: true - /@esbuild/openbsd-x64@0.18.13: - resolution: {integrity: sha512-W5C5nczhrt1y1xPG5bV+0M12p2vetOGlvs43LH8SopQ3z2AseIROu09VgRqydx5qFN7y9qCbpgHLx0kb0TcW7g==} + /@esbuild/openbsd-x64@0.18.20: + resolution: {integrity: sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1923,8 +1983,8 @@ packages: requiresBuild: true optional: true - /@esbuild/sunos-x64@0.18.13: - resolution: {integrity: sha512-X/xzuw4Hzpo/yq3YsfBbIsipNgmsm8mE/QeWbdGdTTeZ77fjxI2K0KP3AlhZ6gU3zKTw1bKoZTuKLnqcJ537qw==} + /@esbuild/sunos-x64@0.18.20: + resolution: {integrity: sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1940,8 +2000,8 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-arm64@0.18.13: - resolution: {integrity: sha512-4CGYdRQT/ILd+yLLE5i4VApMPfGE0RPc/wFQhlluDQCK09+b4JDbxzzjpgQqTPrdnP7r5KUtGVGZYclYiPuHrw==} + /@esbuild/win32-arm64@0.18.20: + resolution: {integrity: sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1957,8 +2017,8 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-ia32@0.18.13: - resolution: {integrity: sha512-D+wKZaRhQI+MUGMH+DbEr4owC2D7XnF+uyGiZk38QbgzLcofFqIOwFs7ELmIeU45CQgfHNy9Q+LKW3cE8g37Kg==} + /@esbuild/win32-ia32@0.18.20: + resolution: {integrity: sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1974,8 +2034,8 @@ packages: requiresBuild: true optional: true - /@esbuild/win32-x64@0.18.13: - resolution: {integrity: sha512-iVl6lehAfJS+VmpF3exKpNQ8b0eucf5VWfzR8S7xFve64NBNz2jPUgx1X93/kfnkfgP737O+i1k54SVQS7uVZA==} + /@esbuild/win32-x64@0.18.20: + resolution: {integrity: sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1983,29 +2043,29 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.42.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.47.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.42.0 - eslint-visitor-keys: 3.4.1 + eslint: 8.47.0 + eslint-visitor-keys: 3.4.3 dev: true - /@eslint-community/regexpp@4.5.1: - resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} + /@eslint-community/regexpp@4.7.0: + resolution: {integrity: sha512-+HencqxU7CFJnQb7IKtuNBqS6Yx3Tz4kOL8BJXo+JyeiBm5MEX6pO8onXDkjrkCRlfYXS1Axro15ZjVFe9YgsA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.0.3: - resolution: {integrity: sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==} + /@eslint/eslintrc@2.1.2: + resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.5.2 - globals: 13.20.0 + espree: 9.6.1 + globals: 13.21.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -2015,8 +2075,8 @@ packages: - supports-color dev: true - /@eslint/js@8.42.0: - resolution: {integrity: sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw==} + /@eslint/js@8.47.0: + resolution: {integrity: sha512-P6omY1zv5MItm93kLM8s2vr1HICJH8v0dvddDhysbIuZ+vcjOHg5Zbkf1mTkcmi2JA9oBG2anOkRnW8WJTS8Og==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -2138,7 +2198,7 @@ packages: nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 - semver: 7.5.1 + semver: 7.5.4 tar: 6.1.13 transitivePeerDependencies: - encoding @@ -2226,7 +2286,7 @@ packages: requiresBuild: true dependencies: '@gar/promisify': 1.1.3 - semver: 7.5.1 + semver: 7.5.4 optional: true /@npmcli/move-file@1.1.2: @@ -2321,7 +2381,7 @@ packages: terser: 5.17.1 dev: true - /@rollup/plugin-typescript@11.1.0(rollup@3.20.7)(typescript@5.1.3): + /@rollup/plugin-typescript@11.1.0(rollup@3.20.7)(typescript@5.1.6): resolution: {integrity: sha512-86flrfE+bSHB69znnTV6kVjkncs2LBMhcTCyxWgRxLyfXfQrxg4UwlAqENnjrrxnSNS/XKCDJCl8EkdFJVHOxw==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2337,10 +2397,10 @@ packages: '@rollup/pluginutils': 5.0.2(rollup@3.20.7) resolve: 1.22.1 rollup: 3.20.7 - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) dev: true - /@rollup/plugin-typescript@11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.3): + /@rollup/plugin-typescript@11.1.1(rollup@3.27.2)(tslib@2.5.2)(typescript@5.1.6): resolution: {integrity: sha512-Ioir+x5Bejv72Lx2Zbz3/qGg7tvGbxQZALCLoJaGrkNXak/19+vKgKYJYM3i/fJxvsb23I9FuFQ8CUBEfsmBRg==} engines: {node: '>=14.0.0'} peerDependencies: @@ -2357,7 +2417,15 @@ packages: resolve: 1.22.2 rollup: 3.27.2 tslib: 2.5.2 - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) + dev: true + + /@rollup/pluginutils@4.2.1: + resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} + engines: {node: '>= 8.0.0'} + dependencies: + estree-walker: 2.0.2 + picomatch: 2.3.1 dev: true /@rollup/pluginutils@5.0.2(rollup@3.20.7): @@ -2405,7 +2473,7 @@ packages: resolution: {integrity: sha512-kc1m5wPBHQCTixwuaOh9vnak/iJm21DrSf9UK6yDE5S3mQQ4u11pqAUiKWnlrZnYkeLfAI9UEHj9OaMT1v5Umg==} engines: {node: '>=14.0.0'} dependencies: - tslib: 2.5.2 + tslib: 2.5.3 /@tootallnate/once@1.1.2: resolution: {integrity: sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==} @@ -2413,22 +2481,22 @@ packages: requiresBuild: true optional: true - /@trivago/prettier-plugin-sort-imports@4.1.1(prettier@2.8.8): - resolution: {integrity: sha512-dQ2r2uzNr1x6pJsuh/8x0IRA3CBUB+pWEW3J/7N98axqt7SQSm+2fy0FLNXvXGg77xEDC7KHxJlHfLYyi7PDcw==} + /@trivago/prettier-plugin-sort-imports@4.2.0(prettier@3.0.2): + resolution: {integrity: sha512-YBepjbt+ZNBVmN3ev1amQH3lWCmHyt5qTbLCp/syXJRu/Kw2koXh44qayB1gMRxcL/gV8egmjN5xWSrYyfUtyw==} peerDependencies: '@vue/compiler-sfc': 3.x - prettier: 2.x + prettier: 2.x - 3.x peerDependenciesMeta: '@vue/compiler-sfc': optional: true dependencies: '@babel/generator': 7.17.7 - '@babel/parser': 7.21.2 + '@babel/parser': 7.22.10 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 javascript-natural-sort: 0.7.1 lodash: 4.17.21 - prettier: 2.8.8 + prettier: 3.0.2 transitivePeerDependencies: - supports-color dev: true @@ -2621,102 +2689,117 @@ packages: dependencies: '@types/node': 20.2.5 - /@typescript-eslint/eslint-plugin@5.59.9(@typescript-eslint/parser@5.59.9)(eslint@8.42.0)(typescript@5.1.3): - resolution: {integrity: sha512-4uQIBq1ffXd2YvF7MAvehWKW3zVv/w+mSfRAu+8cKbfj3nwzyqJLNcZJpQ/WZ1HLbJDiowwmQ6NO+63nCA+fqA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/eslint-plugin@6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-3F5PtBzUW0dYlq77Lcqo13fv+58KDwUib3BddilE8ajPJT+faGgxmI9Sw+I8ZS22BYwoir9ZhNXcLi+S+I2bkw==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@eslint-community/regexpp': 4.5.1 - '@typescript-eslint/parser': 5.59.9(eslint@8.42.0)(typescript@5.1.3) - '@typescript-eslint/scope-manager': 5.59.9 - '@typescript-eslint/type-utils': 5.59.9(eslint@8.42.0)(typescript@5.1.3) - '@typescript-eslint/utils': 5.59.9(eslint@8.42.0)(typescript@5.1.3) + '@eslint-community/regexpp': 4.7.0 + '@typescript-eslint/parser': 6.4.1(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/scope-manager': 6.4.1 + '@typescript-eslint/type-utils': 6.4.1(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@5.1.6) + '@typescript-eslint/visitor-keys': 6.4.1 debug: 4.3.4 - eslint: 8.42.0 - grapheme-splitter: 1.0.4 + eslint: 8.47.0 + graphemer: 1.4.0 ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.1 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + natural-compare: 1.4.0 + semver: 7.5.4 + ts-api-utils: 1.0.2(typescript@5.1.6) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/experimental-utils@5.59.9(eslint@8.42.0)(typescript@5.1.3): - resolution: {integrity: sha512-eZTK/Ci0QAqNc/q2MqMwI2+QI5ZI9HM12FcfGwbEvKif5ev/CIIYLmrlckvgPrC8XSbl39HtErR5NJiQkRkvWg==} + /@typescript-eslint/experimental-utils@5.62.0(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-RTXpeB3eMkpoclG3ZHft6vG/Z30azNHuqY6wKPBHlVMZFuEvrtlEDe8gMqDb+SO+9hjC/pLekeSCryf9vMZlCw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.59.9(eslint@8.42.0)(typescript@5.1.3) - eslint: 8.42.0 + '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@5.1.6) + eslint: 8.47.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/parser@5.59.9(eslint@8.42.0)(typescript@5.1.3): - resolution: {integrity: sha512-FsPkRvBtcLQ/eVK1ivDiNYBjn3TGJdXy2fhXX+rc7czWl4ARwnpArwbihSOHI2Peg9WbtGHrbThfBUkZZGTtvQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/parser@6.4.1(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-610G6KHymg9V7EqOaNBMtD1GgpAmGROsmfHJPXNLCU9bfIuLrkdOygltK784F6Crboyd5tBFayPB7Sf0McrQwg==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 5.59.9 - '@typescript-eslint/types': 5.59.9 - '@typescript-eslint/typescript-estree': 5.59.9(typescript@5.1.3) + '@typescript-eslint/scope-manager': 6.4.1 + '@typescript-eslint/types': 6.4.1 + '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.1.6) + '@typescript-eslint/visitor-keys': 6.4.1 debug: 4.3.4 - eslint: 8.42.0 - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + eslint: 8.47.0 + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@5.59.9: - resolution: {integrity: sha512-8RA+E+w78z1+2dzvK/tGZ2cpGigBZ58VMEHDZtpE1v+LLjzrYGc8mMaTONSxKyEkz3IuXFM0IqYiGHlCsmlZxQ==} + /@typescript-eslint/scope-manager@5.62.0: + resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.9 - '@typescript-eslint/visitor-keys': 5.59.9 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/type-utils@5.59.9(eslint@8.42.0)(typescript@5.1.3): - resolution: {integrity: sha512-ksEsT0/mEHg9e3qZu98AlSrONAQtrSTljL3ow9CGej8eRo7pe+yaC/mvTjptp23Xo/xIf2mLZKC6KPv4Sji26Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@typescript-eslint/scope-manager@6.4.1: + resolution: {integrity: sha512-p/OavqOQfm4/Hdrr7kvacOSFjwQ2rrDVJRPxt/o0TOWdFnjJptnjnZ+sYDR7fi4OimvIuKp+2LCkc+rt9fIW+A==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.4.1 + '@typescript-eslint/visitor-keys': 6.4.1 + dev: true + + /@typescript-eslint/type-utils@6.4.1(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-7ON8M8NXh73SGZ5XvIqWHjgX2f+vvaOarNliGhjrJnv1vdjG0LVIz+ToYfPirOoBi56jxAKLfsLm40+RvxVVXA==} + engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: - eslint: '*' + eslint: ^7.0.0 || ^8.0.0 typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 5.59.9(typescript@5.1.3) - '@typescript-eslint/utils': 5.59.9(eslint@8.42.0)(typescript@5.1.3) + '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.1.6) + '@typescript-eslint/utils': 6.4.1(eslint@8.47.0)(typescript@5.1.6) debug: 4.3.4 - eslint: 8.42.0 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + eslint: 8.47.0 + ts-api-utils: 1.0.2(typescript@5.1.6) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@5.59.9: - resolution: {integrity: sha512-uW8H5NRgTVneSVTfiCVffBb8AbwWSKg7qcA4Ot3JI3MPCJGsB4Db4BhvAODIIYE5mNj7Q+VJkK7JxmRhk2Lyjw==} + /@typescript-eslint/types@5.62.0: + resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/typescript-estree@5.59.9(typescript@5.1.3): - resolution: {integrity: sha512-pmM0/VQ7kUhd1QyIxgS+aRvMgw+ZljB3eDb+jYyp6d2bC0mQWLzUDF+DLwCTkQ3tlNyVsvZRXjFyV0LkU/aXjA==} + /@typescript-eslint/types@6.4.1: + resolution: {integrity: sha512-zAAopbNuYu++ijY1GV2ylCsQsi3B8QvfPHVqhGdDcbx/NK5lkqMnCGU53amAjccSpk+LfeONxwzUhDzArSfZJg==} + engines: {node: ^16.0.0 || >=18.0.0} + dev: true + + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.1.6): + resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: typescript: '*' @@ -2724,44 +2807,92 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 5.59.9 - '@typescript-eslint/visitor-keys': 5.59.9 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/visitor-keys': 5.62.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 - semver: 7.5.1 - tsutils: 3.21.0(typescript@5.1.3) - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@5.59.9(eslint@8.42.0)(typescript@5.1.3): - resolution: {integrity: sha512-1PuMYsju/38I5Ggblaeb98TOoUvjhRvLpLa1DoTOFaLWqaXl/1iQ1eGurTXgBY58NUdtfTXKP5xBq7q9NDaLKg==} + /@typescript-eslint/typescript-estree@6.4.1(typescript@5.1.6): + resolution: {integrity: sha512-xF6Y7SatVE/OyV93h1xGgfOkHr2iXuo8ip0gbfzaKeGGuKiAnzS+HtVhSPx8Www243bwlW8IF7X0/B62SzFftg==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 6.4.1 + '@typescript-eslint/visitor-keys': 6.4.1 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + ts-api-utils: 1.0.2(typescript@5.1.6) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@5.62.0(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) '@types/json-schema': 7.0.12 '@types/semver': 7.5.0 - '@typescript-eslint/scope-manager': 5.59.9 - '@typescript-eslint/types': 5.59.9 - '@typescript-eslint/typescript-estree': 5.59.9(typescript@5.1.3) - eslint: 8.42.0 + '@typescript-eslint/scope-manager': 5.62.0 + '@typescript-eslint/types': 5.62.0 + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.1.6) + eslint: 8.47.0 eslint-scope: 5.1.1 - semver: 7.5.1 + semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@5.59.9: - resolution: {integrity: sha512-bT7s0td97KMaLwpEBckbzj/YohnvXtqbe2XgqNvTl6RJVakY5mvENOTPvw5u66nljfZxthESpDozs86U+oLY8Q==} + /@typescript-eslint/utils@6.4.1(eslint@8.47.0)(typescript@5.1.6): + resolution: {integrity: sha512-F/6r2RieNeorU0zhqZNv89s9bDZSovv3bZQpUNOmmQK1L80/cV4KEu95YUJWi75u5PhboFoKUJBnZ4FQcoqhDw==} + engines: {node: ^16.0.0 || >=18.0.0} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) + '@types/json-schema': 7.0.12 + '@types/semver': 7.5.0 + '@typescript-eslint/scope-manager': 6.4.1 + '@typescript-eslint/types': 6.4.1 + '@typescript-eslint/typescript-estree': 6.4.1(typescript@5.1.6) + eslint: 8.47.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@5.62.0: + resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - '@typescript-eslint/types': 5.59.9 - eslint-visitor-keys: 3.4.1 + '@typescript-eslint/types': 5.62.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@typescript-eslint/visitor-keys@6.4.1: + resolution: {integrity: sha512-y/TyRJsbZPkJIZQXrHfdnxVnxyKegnpEvnRGNam7s3TRR2ykGefEWOhaef00/UUN3IZxizS7BTO3svd3lCOJRQ==} + engines: {node: ^16.0.0 || >=18.0.0} + dependencies: + '@typescript-eslint/types': 6.4.1 + eslint-visitor-keys: 3.4.3 dev: true /@typescript/analyze-trace@0.10.0: @@ -2847,18 +2978,24 @@ packages: negotiator: 0.6.3 dev: false - /acorn-jsx@5.3.2(acorn@8.8.2): + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.10.0 dev: true /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} @@ -2984,6 +3121,13 @@ packages: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} dev: true + /array-buffer-byte-length@1.0.0: + resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} + dependencies: + call-bind: 1.0.2 + is-array-buffer: 3.0.2 + dev: true + /array-find-index@1.0.2: resolution: {integrity: sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==} engines: {node: '>=0.10.0'} @@ -2999,8 +3143,8 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 - get-intrinsic: 1.2.0 + es-abstract: 1.22.1 + get-intrinsic: 1.2.1 is-string: 1.0.7 dev: true @@ -3009,13 +3153,24 @@ packages: engines: {node: '>=8'} dev: true + /array.prototype.findlastindex@1.2.2: + resolution: {integrity: sha512-tb5thFFlUcp7NdNF6/MpDk/1r/4awWG1FIz3YqDf+/zJSTezBb+/5WViH41obXULHVpDzoiCLpJ/ZO9YbJMsdw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + es-shim-unscopables: 1.0.0 + get-intrinsic: 1.2.1 + dev: true + /array.prototype.flat@1.3.1: resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 dev: true @@ -3025,10 +3180,22 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.22.1 es-shim-unscopables: 1.0.0 dev: true + /arraybuffer.prototype.slice@1.0.1: + resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} + engines: {node: '>= 0.4'} + dependencies: + array-buffer-byte-length: 1.0.0 + call-bind: 1.0.2 + define-properties: 1.2.0 + get-intrinsic: 1.2.1 + is-array-buffer: 3.0.2 + is-shared-array-buffer: 1.0.2 + dev: true + /arrgv@1.0.2: resolution: {integrity: sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==} engines: {node: '>=8.0.0'} @@ -3264,10 +3431,6 @@ packages: dependencies: fill-range: 7.0.1 - /buffer-crc32@0.2.13: - resolution: {integrity: sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==} - dev: true - /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -3310,8 +3473,8 @@ packages: resolution: {integrity: sha512-/LL3zPv7d+ZvHSD6TIhVB7l8h1rrMvuGlwILTGHrJJeAaHKq+7RgIV6N8A8kzhkYMFuTq9o2P/2o8gUL7RHtzg==} dev: true - /bun-types@0.6.7: - resolution: {integrity: sha512-LZjqqhQfr+Rue3TRwF4Z8v37shty7SnovflUb9kdJfsbuLfMlS+sPMMyFz4eU8H1BxkbK4P+P+nXXDaLOpwqxg==} + /bun-types@0.7.3: + resolution: {integrity: sha512-kssLD5mDLoawmLZFgQRRq0Wy+dca/os6TZ0MHWyFVoVAEwSrpAxmNCZ1K1GUelfhlDaL2FikRxeF9GkATdzXZg==} dev: true /busboy@1.6.0: @@ -3419,6 +3582,11 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true + /chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: true + /check-error@1.0.2: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} @@ -3434,7 +3602,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /chownr@1.1.4: @@ -3559,9 +3727,9 @@ packages: dependencies: delayed-stream: 1.0.0 - /commander@10.0.0: - resolution: {integrity: sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==} - engines: {node: '>=14'} + /commander@11.0.0: + resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} + engines: {node: '>=16'} dev: true /commander@2.20.3: @@ -3577,6 +3745,10 @@ packages: resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} dev: true + /commondir@1.0.1: + resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} + dev: true + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} requiresBuild: true @@ -3610,6 +3782,22 @@ packages: yargs: 17.7.2 dev: true + /concurrently@8.2.1: + resolution: {integrity: sha512-nVraf3aXOpIcNud5pB9M82p1tynmZkrSGQ1p6X/VY8cJ+2LMVqAgXsJxYYefACSHbTYlm92O1xuhdGTjwoEvbQ==} + engines: {node: ^14.13.0 || >=16.0.0} + hasBin: true + dependencies: + chalk: 4.1.2 + date-fns: 2.30.0 + lodash: 4.17.21 + rxjs: 7.8.1 + shell-quote: 1.8.1 + spawn-command: 0.0.2 + supports-color: 8.1.1 + tree-kill: 1.2.2 + yargs: 17.7.2 + dev: true + /console-control-strings@1.1.0: resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==} @@ -3648,8 +3836,8 @@ packages: p-event: 5.0.1 dev: true - /cpu-features@0.0.8: - resolution: {integrity: sha512-BbHBvtYhUhksqTjr6bhNOjGgMnhwhGTQmOoZGD+K7BCaQDCuZl/Ve1ZxUSMRwVC4D/rkCPQ2MAIeYzrWyK7eEg==} + /cpu-features@0.0.9: + resolution: {integrity: sha512-AKjgn2rP2yJyfbepsmLfiYcmtNn/2eUvocUyM/09yB0YDiz39HteK/5/T4Onf0pmdYDMgkBoGvRLvEguzyL7wQ==} engines: {node: '>=10.0.0'} requiresBuild: true dependencies: @@ -3712,7 +3900,7 @@ packages: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} dependencies: - '@babel/runtime': 7.22.3 + '@babel/runtime': 7.22.10 dev: true /date-time@3.1.0: @@ -3891,15 +4079,17 @@ packages: engines: {node: '>=12'} dev: false - /dprint@0.37.1: - resolution: {integrity: sha512-MVKIVOvk5FSiZQFFZlLv1KiB4zZXAirlZ/m8vtyKu2PTFnkD5d6jVv4aNHvd7M6f1ToganNZ/CqhSwpgadn8Ug==} + /dprint@0.40.2: + resolution: {integrity: sha512-3LdyUV0itEW59UPtsRA2StOWOu8FyOW+BgvJpH/tACRHKi0z5gaQnvSxdS3mbG7dgtEhdRnGg6JoiQyGib6NTg==} hasBin: true requiresBuild: true - dependencies: - https-proxy-agent: 5.0.1 - yauzl: 2.10.0 - transitivePeerDependencies: - - supports-color + optionalDependencies: + '@dprint/darwin-arm64': 0.40.2 + '@dprint/darwin-x64': 0.40.2 + '@dprint/linux-arm64-glibc': 0.40.2 + '@dprint/linux-x64-glibc': 0.40.2 + '@dprint/linux-x64-musl': 0.40.2 + '@dprint/win32-x64': 0.40.2 dev: true /dreamopt@0.8.0: @@ -3909,27 +4099,27 @@ packages: wordwrap: 1.0.0 dev: true - /drizzle-kit@0.19.5: - resolution: {integrity: sha512-eX+M4QpPLbbZwLUamCxRhS9Y98ppZLk3jew2FghKoAr7bGEC3omFIm+YPiwtrhe/alZZgrJCn/1TDTRHwo1r9w==} + /drizzle-kit@0.19.13: + resolution: {integrity: sha512-Rba5VW1O2JfJlwVBeZ8Zwt2E2us5oZ08PQBDiVSGlug53TOc8hzXjblZFuF+dnll9/RQEHrkzBmJFgqTvn5Rxg==} hasBin: true dependencies: - '@drizzle-team/studio': 0.0.1 + '@drizzle-team/studio': 0.0.5 '@esbuild-kit/esm-loader': 2.5.5 camelcase: 7.0.1 - chalk: 5.2.0 + chalk: 5.3.0 commander: 9.5.0 - esbuild: 0.18.13 - esbuild-register: 3.4.2(esbuild@0.18.13) + esbuild: 0.18.20 + esbuild-register: 3.4.2(esbuild@0.18.20) glob: 8.1.0 hanji: 0.0.5 json-diff: 0.9.0 minimatch: 7.4.6 - zod: 3.21.4 + zod: 3.22.2 transitivePeerDependencies: - supports-color dev: true - /drizzle-orm@0.27.2(bun-types@0.6.7): + /drizzle-orm@0.27.2(bun-types@0.7.3): resolution: {integrity: sha512-ZvBvceff+JlgP7FxHKe0zOU9CkZ4RcOtibumIrqfYzDGuOeF0YUY0F9iMqYpRM7pxnLRfC+oO7rWOUH3T5oFQA==} peerDependencies: '@aws-sdk/client-rds-data': '>=3' @@ -3991,7 +4181,7 @@ packages: sqlite3: optional: true dependencies: - bun-types: 0.6.7 + bun-types: 0.7.3 dev: true /duplexer@0.1.2: @@ -4052,17 +4242,18 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract@1.21.1: - resolution: {integrity: sha512-QudMsPOz86xYz/1dG1OuGBKOELjCh99IIWHLzy5znUB6j8xG2yMA7bfTV86VSqKF+Y/H08vQPR+9jyXpuC6hfg==} + /es-abstract@1.22.1: + resolution: {integrity: sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==} engines: {node: '>= 0.4'} dependencies: + array-buffer-byte-length: 1.0.0 + arraybuffer.prototype.slice: 1.0.1 available-typed-arrays: 1.0.5 call-bind: 1.0.2 es-set-tostringtag: 2.0.1 es-to-primitive: 1.2.1 - function-bind: 1.1.1 function.prototype.name: 1.1.5 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 get-symbol-description: 1.0.0 globalthis: 1.0.3 gopd: 1.0.1 @@ -4077,25 +4268,30 @@ packages: is-regex: 1.1.4 is-shared-array-buffer: 1.0.2 is-string: 1.0.7 - is-typed-array: 1.1.10 + is-typed-array: 1.1.12 is-weakref: 1.0.2 object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 - regexp.prototype.flags: 1.4.3 + regexp.prototype.flags: 1.5.0 + safe-array-concat: 1.0.0 safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 + typed-array-buffer: 1.0.0 + typed-array-byte-length: 1.0.0 + typed-array-byte-offset: 1.0.0 typed-array-length: 1.0.4 unbox-primitive: 1.0.2 - which-typed-array: 1.1.9 + which-typed-array: 1.1.11 dev: true /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 has: 1.0.3 has-tostringtag: 1.0.0 dev: true @@ -4293,13 +4489,13 @@ packages: dev: true optional: true - /esbuild-register@3.4.2(esbuild@0.18.13): + /esbuild-register@3.4.2(esbuild@0.18.20): resolution: {integrity: sha512-kG/XyTDyz6+YDuyfB9ZoSIOOmgyFCH+xPRtsCa8W85HLRV5Csp+o3jWVbOSHgSLfyLc5DmP+KFDNwty4mEjC+Q==} peerDependencies: esbuild: '>=0.12 <1' dependencies: debug: 4.3.4 - esbuild: 0.18.13 + esbuild: 0.18.20 transitivePeerDependencies: - supports-color dev: true @@ -4398,34 +4594,34 @@ packages: '@esbuild/win32-ia32': 0.17.19 '@esbuild/win32-x64': 0.17.19 - /esbuild@0.18.13: - resolution: {integrity: sha512-vhg/WR/Oiu4oUIkVhmfcc23G6/zWuEQKFS+yiosSHe4aN6+DQRXIfeloYGibIfVhkr4wyfuVsGNLr+sQU1rWWw==} + /esbuild@0.18.20: + resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.18.13 - '@esbuild/android-arm64': 0.18.13 - '@esbuild/android-x64': 0.18.13 - '@esbuild/darwin-arm64': 0.18.13 - '@esbuild/darwin-x64': 0.18.13 - '@esbuild/freebsd-arm64': 0.18.13 - '@esbuild/freebsd-x64': 0.18.13 - '@esbuild/linux-arm': 0.18.13 - '@esbuild/linux-arm64': 0.18.13 - '@esbuild/linux-ia32': 0.18.13 - '@esbuild/linux-loong64': 0.18.13 - '@esbuild/linux-mips64el': 0.18.13 - '@esbuild/linux-ppc64': 0.18.13 - '@esbuild/linux-riscv64': 0.18.13 - '@esbuild/linux-s390x': 0.18.13 - '@esbuild/linux-x64': 0.18.13 - '@esbuild/netbsd-x64': 0.18.13 - '@esbuild/openbsd-x64': 0.18.13 - '@esbuild/sunos-x64': 0.18.13 - '@esbuild/win32-arm64': 0.18.13 - '@esbuild/win32-ia32': 0.18.13 - '@esbuild/win32-x64': 0.18.13 + '@esbuild/android-arm': 0.18.20 + '@esbuild/android-arm64': 0.18.20 + '@esbuild/android-x64': 0.18.20 + '@esbuild/darwin-arm64': 0.18.20 + '@esbuild/darwin-x64': 0.18.20 + '@esbuild/freebsd-arm64': 0.18.20 + '@esbuild/freebsd-x64': 0.18.20 + '@esbuild/linux-arm': 0.18.20 + '@esbuild/linux-arm64': 0.18.20 + '@esbuild/linux-ia32': 0.18.20 + '@esbuild/linux-loong64': 0.18.20 + '@esbuild/linux-mips64el': 0.18.20 + '@esbuild/linux-ppc64': 0.18.20 + '@esbuild/linux-riscv64': 0.18.20 + '@esbuild/linux-s390x': 0.18.20 + '@esbuild/linux-x64': 0.18.20 + '@esbuild/netbsd-x64': 0.18.20 + '@esbuild/openbsd-x64': 0.18.20 + '@esbuild/sunos-x64': 0.18.20 + '@esbuild/win32-arm64': 0.18.20 + '@esbuild/win32-ia32': 0.18.20 + '@esbuild/win32-x64': 0.18.20 dev: true /escalade@3.1.1: @@ -4457,18 +4653,18 @@ packages: engines: {node: '>=12'} dev: true - /eslint-import-resolver-node@0.3.7: - resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==} + /eslint-import-resolver-node@0.3.9: + resolution: {integrity: sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==} dependencies: debug: 3.2.7 - is-core-module: 2.11.0 - resolve: 1.22.2 + is-core-module: 2.13.0 + resolve: 1.22.4 transitivePeerDependencies: - supports-color dev: true - /eslint-module-utils@2.7.4(@typescript-eslint/parser@5.59.9)(eslint-import-resolver-node@0.3.7)(eslint@8.42.0): - resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.4.1)(eslint-import-resolver-node@0.3.9)(eslint@8.47.0): + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -4488,16 +4684,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 5.59.9(eslint@8.42.0)(typescript@5.1.3) + '@typescript-eslint/parser': 6.4.1(eslint@8.47.0)(typescript@5.1.6) debug: 3.2.7 - eslint: 8.42.0 - eslint-import-resolver-node: 0.3.7 + eslint: 8.47.0 + eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-import@2.27.5(@typescript-eslint/parser@5.59.9)(eslint@8.42.0): - resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} + /eslint-plugin-import@2.28.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0): + resolution: {integrity: sha512-9I9hFlITvOV55alzoKBI+K9q74kv0iKMeY6av5+umsNwayt59fz692daGyjR+oStBQgx6nwR9rXldDev3Clw+A==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -4506,22 +4702,24 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 5.59.9(eslint@8.42.0)(typescript@5.1.3) + '@typescript-eslint/parser': 6.4.1(eslint@8.47.0)(typescript@5.1.6) array-includes: 3.1.6 + array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 array.prototype.flatmap: 1.3.1 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.42.0 - eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4(@typescript-eslint/parser@5.59.9)(eslint-import-resolver-node@0.3.7)(eslint@8.42.0) + eslint: 8.47.0 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.4.1)(eslint-import-resolver-node@0.3.9)(eslint@8.47.0) has: 1.0.3 - is-core-module: 2.11.0 + is-core-module: 2.13.0 is-glob: 4.0.3 minimatch: 3.1.2 + object.fromentries: 2.0.6 + object.groupby: 1.0.0 object.values: 1.1.6 - resolve: 1.22.1 - semver: 6.3.0 + semver: 6.3.1 tsconfig-paths: 3.14.2 transitivePeerDependencies: - eslint-import-resolver-typescript @@ -4533,17 +4731,17 @@ packages: resolution: {integrity: sha512-zlqQ7EsfzbRO68uI+p8FIE7zYB4njs+nNbkNjSb5QmLi2et67zQLqSeaao5U9SpnlZTTJC87nS2oyHo2ACtajw==} dev: true - /eslint-plugin-unicorn@47.0.0(eslint@8.42.0): - resolution: {integrity: sha512-ivB3bKk7fDIeWOUmmMm9o3Ax9zbMz1Bsza/R2qm46ufw4T6VBFBaJIR1uN3pCKSmSXm8/9Nri8V+iUut1NhQGA==} + /eslint-plugin-unicorn@48.0.1(eslint@8.47.0): + resolution: {integrity: sha512-FW+4r20myG/DqFcCSzoumaddKBicIPeFnTrifon2mWIzlfyvzwyqZjqVP7m4Cqr/ZYisS2aiLghkUWaPg6vtCw==} engines: {node: '>=16'} peerDependencies: - eslint: '>=8.38.0' + eslint: '>=8.44.0' dependencies: - '@babel/helper-validator-identifier': 7.19.1 - '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) + '@babel/helper-validator-identifier': 7.22.5 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) ci-info: 3.8.0 clean-regexp: 1.0.0 - eslint: 8.42.0 + eslint: 8.47.0 esquery: 1.5.0 indent-string: 4.0.0 is-builtin-module: 3.2.1 @@ -4553,23 +4751,22 @@ packages: read-pkg-up: 7.0.1 regexp-tree: 0.1.27 regjsparser: 0.10.0 - safe-regex: 2.1.1 - semver: 7.5.1 + semver: 7.5.4 strip-indent: 3.0.0 dev: true - /eslint-plugin-unused-imports@2.0.0(@typescript-eslint/eslint-plugin@5.59.9)(eslint@8.42.0): - resolution: {integrity: sha512-3APeS/tQlTrFa167ThtP0Zm0vctjr4M44HMpeg1P4bK6wItarumq0Ma82xorMKdFsWpphQBlRPzw/pxiVELX1A==} + /eslint-plugin-unused-imports@3.0.0(@typescript-eslint/eslint-plugin@6.4.1)(eslint@8.47.0): + resolution: {integrity: sha512-sduiswLJfZHeeBJ+MQaG+xYzSWdRXoSw61DpU13mzWumCkR0ufD0HmO4kdNokjrkluMHpj/7PJeN35pgbhW3kw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: - '@typescript-eslint/eslint-plugin': ^5.0.0 + '@typescript-eslint/eslint-plugin': ^6.0.0 eslint: ^8.0.0 peerDependenciesMeta: '@typescript-eslint/eslint-plugin': optional: true dependencies: - '@typescript-eslint/eslint-plugin': 5.59.9(@typescript-eslint/parser@5.59.9)(eslint@8.42.0)(typescript@5.1.3) - eslint: 8.42.0 + '@typescript-eslint/eslint-plugin': 6.4.1(@typescript-eslint/parser@6.4.1)(eslint@8.47.0)(typescript@5.1.6) + eslint: 8.47.0 eslint-rule-composer: 0.3.0 dev: true @@ -4586,28 +4783,28 @@ packages: estraverse: 4.3.0 dev: true - /eslint-scope@7.2.0: - resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + /eslint-scope@7.2.2: + resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 dev: true - /eslint-visitor-keys@3.4.1: - resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} + /eslint-visitor-keys@3.4.3: + resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.42.0: - resolution: {integrity: sha512-ulg9Ms6E1WPf67PHaEY4/6E2tEn5/f7FXGzr3t9cBMugOmf1INYvuUwwh1aXQN4MfJ6a5K2iNwP3w4AColvI9A==} + /eslint@8.47.0: + resolution: {integrity: sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.42.0) - '@eslint-community/regexpp': 4.5.1 - '@eslint/eslintrc': 2.0.3 - '@eslint/js': 8.42.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.47.0) + '@eslint-community/regexpp': 4.7.0 + '@eslint/eslintrc': 2.1.2 + '@eslint/js': 8.47.0 '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -4617,19 +4814,18 @@ packages: debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.0 - eslint-visitor-keys: 3.4.1 - espree: 9.5.2 + eslint-scope: 7.2.2 + eslint-visitor-keys: 3.4.3 + espree: 9.6.1 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 file-entry-cache: 6.0.1 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.20.0 + globals: 13.21.0 graphemer: 1.4.0 ignore: 5.2.4 - import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 @@ -4639,9 +4835,8 @@ packages: lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.3 strip-ansi: 6.0.1 - strip-json-comments: 3.1.1 text-table: 0.2.0 transitivePeerDependencies: - supports-color @@ -4652,13 +4847,13 @@ packages: engines: {node: '>=6'} dev: true - /espree@9.5.2: - resolution: {integrity: sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==} + /espree@9.6.1: + resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.4.1 + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.3 dev: true /esprima@4.0.1: @@ -4809,6 +5004,17 @@ packages: merge2: 1.4.1 micromatch: 4.0.5 + /fast-glob@3.3.1: + resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true @@ -4828,12 +5034,6 @@ packages: dependencies: reusify: 1.0.4 - /fd-slicer@1.1.0: - resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - dependencies: - pend: 1.2.0 - dev: true - /fetch-blob@3.2.0: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} @@ -4884,6 +5084,15 @@ packages: - supports-color dev: false + /find-cache-dir@3.3.2: + resolution: {integrity: sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==} + engines: {node: '>=8'} + dependencies: + commondir: 1.0.1 + make-dir: 3.1.0 + pkg-dir: 4.2.0 + dev: true + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -4984,6 +5193,15 @@ packages: /fs-constants@1.0.0: resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + /fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.0 + dev: true + /fs-extra@11.1.1: resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} engines: {node: '>=14.14'} @@ -5003,8 +5221,8 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} requiresBuild: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -5019,7 +5237,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.22.1 functions-have-names: 1.2.3 dev: true @@ -5080,6 +5298,15 @@ packages: has: 1.0.3 has-symbols: 1.0.3 + /get-intrinsic@1.2.1: + resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-proto: 1.0.1 + has-symbols: 1.0.3 + dev: true + /get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} @@ -5100,7 +5327,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true /get-tsconfig@4.5.0: @@ -5166,8 +5393,8 @@ packages: engines: {node: '>=4'} dev: true - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} + /globals@13.21.0: + resolution: {integrity: sha512-ybyme3s4yy/t/3s35bewwXKOf7cvzfreG2lH0lZl0JB7I4GxRP2ghxOK/Nb9EkRXdbBXZLfq/p/0W2JUONB/Gg==} engines: {node: '>=8'} dependencies: type-fest: 0.20.2 @@ -5186,7 +5413,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.1 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -5221,16 +5448,12 @@ packages: /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: true - /graphemer@1.4.0: resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true @@ -5259,7 +5482,7 @@ packages: /has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true /has-proto@1.0.1: @@ -5415,7 +5638,7 @@ packages: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 has: 1.0.3 side-channel: 1.0.4 dev: true @@ -5444,8 +5667,8 @@ packages: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 - is-typed-array: 1.1.10 + get-intrinsic: 1.2.1 + is-typed-array: 1.1.12 dev: true /is-arrayish@0.2.1: @@ -5497,6 +5720,12 @@ packages: has: 1.0.3 dev: true + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: true + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} @@ -5612,15 +5841,11 @@ packages: has-symbols: 1.0.3 dev: true - /is-typed-array@1.1.10: - resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} + /is-typed-array@1.1.12: + resolution: {integrity: sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==} engines: {node: '>= 0.4'} dependencies: - available-typed-arrays: 1.0.5 - call-bind: 1.0.2 - for-each: 0.3.3 - gopd: 1.0.1 - has-tostringtag: 1.0.0 + which-typed-array: 1.1.11 dev: true /is-unicode-supported@1.3.0: @@ -5634,6 +5859,10 @@ packages: call-bind: 1.0.2 dev: true + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -5719,7 +5948,7 @@ packages: resolution: {integrity: sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==} hasBin: true dependencies: - minimist: 1.2.7 + minimist: 1.2.8 dev: true /jsonc-parser@3.2.0: @@ -6086,10 +6315,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimist@1.2.7: - resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} - dev: true - /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -6228,10 +6453,6 @@ packages: /napi-build-utils@1.0.2: resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true - /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true @@ -6311,7 +6532,7 @@ packages: nopt: 5.0.0 npmlog: 6.0.2 rimraf: 3.0.2 - semver: 7.5.1 + semver: 7.5.4 tar: 6.1.13 which: 2.0.2 transitivePeerDependencies: @@ -6335,8 +6556,8 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.2 - semver: 5.7.1 + resolve: 1.22.4 + semver: 5.7.2 validate-npm-package-license: 3.0.4 dev: true @@ -6402,13 +6623,31 @@ packages: object-keys: 1.1.1 dev: true + /object.fromentries@2.0.6: + resolution: {integrity: sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + dev: true + + /object.groupby@1.0.0: + resolution: {integrity: sha512-70MWG6NfRH9GnbZOikuhPPYzpUpof9iW2J9E4dW7FXTqPNb6rllE6u39SKwwiNh8lCwX3DDb5OgcKGiEBrTTyw==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + get-intrinsic: 1.2.1 + dev: true + /object.values@1.1.6: resolution: {integrity: sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.22.1 dev: true /obuf@1.1.2: @@ -6433,16 +6672,16 @@ packages: mimic-fn: 4.0.0 dev: false - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 dev: true /p-defer@1.0.0: @@ -6548,7 +6787,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.10 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -6625,10 +6864,6 @@ packages: through: 2.3.8 dev: true - /pend@1.2.0: - resolution: {integrity: sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==} - dev: true - /pg-cloudflare@1.1.1: resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} requiresBuild: true @@ -6720,6 +6955,13 @@ packages: load-json-file: 7.0.1 dev: true + /pkg-dir@4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + /pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} dependencies: @@ -6812,9 +7054,9 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} + /prettier@3.0.2: + resolution: {integrity: sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ==} + engines: {node: '>=14'} hasBin: true dev: true @@ -6967,8 +7209,8 @@ packages: resolve: 1.22.2 dev: true - /regenerator-runtime@0.13.11: - resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} + /regenerator-runtime@0.14.0: + resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} dev: true /regexp-tree@0.1.27: @@ -6976,8 +7218,8 @@ packages: hasBin: true dev: true - /regexp.prototype.flags@1.4.3: - resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + /regexp.prototype.flags@1.5.0: + resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 @@ -7013,16 +7255,16 @@ packages: engines: {node: '>=8'} dev: true - /resolve-tspaths@0.8.13(typescript@5.1.3): - resolution: {integrity: sha512-eHlHinC2qt3jQLFiZyUE4HXZOTlT1abHO2fb+OI9Ybsn8wdhKiAtIFVy1+QVTaIQNphCLvm42EkqJt/+ZAA8Sw==} + /resolve-tspaths@0.8.15(typescript@5.1.6): + resolution: {integrity: sha512-uqxasvZ7WGMfaozpwSLo5nEV/TBnbwMSV7df7hLfwtmGNQlqO1ljcTJ5s8EX9MidKlMQLnczCwur9gFtbOc6pA==} hasBin: true peerDependencies: typescript: '>=3.0.3' dependencies: ansi-colors: 4.1.3 - commander: 10.0.0 - fast-glob: 3.2.12 - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + commander: 11.0.0 + fast-glob: 3.3.1 + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) dev: true /resolve@1.22.1: @@ -7043,6 +7285,15 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true + /resolve@1.22.4: + resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} + hasBin: true + dependencies: + is-core-module: 2.13.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + /retry@0.12.0: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} @@ -7067,7 +7318,7 @@ packages: glob: 10.2.2 dev: true - /rollup-plugin-dts@5.3.1(rollup@3.27.2)(typescript@5.1.3): + /rollup-plugin-dts@5.3.1(rollup@3.27.2)(typescript@5.1.6): resolution: {integrity: sha512-gusMi+Z4gY/JaEQeXnB0RUdU82h1kF0WYzCWgVmV4p3hWXqelaKuCvcJawfeg+EKn2T1Ie+YWF2OiN1/L8bTVg==} engines: {node: '>=v14.21.3'} peerDependencies: @@ -7076,9 +7327,24 @@ packages: dependencies: magic-string: 0.30.2 rollup: 3.27.2 - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) optionalDependencies: - '@babel/code-frame': 7.22.5 + '@babel/code-frame': 7.22.10 + dev: true + + /rollup-plugin-typescript2@0.35.0(rollup@3.27.2)(typescript@5.1.6): + resolution: {integrity: sha512-szcIO9hPUx3PhQl91u4pfNAH2EKbtrXaES+m163xQVE5O1CC0ea6YZV/5woiDDW3CR9jF2CszPrKN+AFiND0bg==} + peerDependencies: + rollup: '>=1.26.3' + typescript: '>=2.4.0' + dependencies: + '@rollup/pluginutils': 4.2.1 + find-cache-dir: 3.3.2 + fs-extra: 10.1.0 + rollup: 3.27.2 + semver: 7.5.1 + tslib: 2.5.3 + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) dev: true /rollup@3.20.7: @@ -7086,7 +7352,7 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /rollup@3.27.2: @@ -7094,7 +7360,7 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -7104,7 +7370,7 @@ packages: /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: - tslib: 2.5.3 + tslib: 2.6.2 dev: true /sade@1.8.1: @@ -7114,6 +7380,16 @@ packages: mri: 1.2.0 dev: false + /safe-array-concat@1.0.0: + resolution: {integrity: sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==} + engines: {node: '>=0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + has-symbols: 1.0.3 + isarray: 2.0.5 + dev: true + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} @@ -7121,21 +7397,15 @@ packages: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 is-regex: 1.1.4 dev: true - /safe-regex@2.1.1: - resolution: {integrity: sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==} - dependencies: - regexp-tree: 0.1.27 - dev: true - /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - /semver@5.7.1: - resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true dev: true @@ -7143,6 +7413,11 @@ packages: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + dev: true + /semver@7.5.1: resolution: {integrity: sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==} engines: {node: '>=10'} @@ -7150,6 +7425,13 @@ packages: dependencies: lru-cache: 6.0.0 + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -7332,6 +7614,10 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + /spawn-command@0.0.2: + resolution: {integrity: sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==} + dev: true + /spawn-command@0.0.2-1: resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==} dev: true @@ -7414,7 +7700,7 @@ packages: asn1: 0.2.6 bcrypt-pbkdf: 1.0.2 optionalDependencies: - cpu-features: 0.0.8 + cpu-features: 0.0.9 nan: 2.17.0 dev: false @@ -7472,12 +7758,21 @@ packages: strip-ansi: 7.1.0 dev: true + /string.prototype.trim@1.2.7: + resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.22.1 + dev: true + /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.22.1 dev: true /string.prototype.trimstart@1.0.6: @@ -7485,7 +7780,7 @@ packages: dependencies: call-bind: 1.0.2 define-properties: 1.2.0 - es-abstract: 1.21.1 + es-abstract: 1.22.1 dev: true /string_decoder@1.3.0: @@ -7716,7 +8011,16 @@ packages: engines: {node: '>=0.6'} dev: false - /tsconfck@2.1.1(typescript@5.1.3): + /ts-api-utils@1.0.2(typescript@5.1.6): + resolution: {integrity: sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==} + engines: {node: '>=16.13.0'} + peerDependencies: + typescript: '>=4.2.0' + dependencies: + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) + dev: true + + /tsconfck@2.1.1(typescript@5.1.6): resolution: {integrity: sha512-ZPCkJBKASZBmBUNqGHmRhdhM8pJYDdOXp4nRgj/O0JwUwsMq50lCDRQP/M5GBNAA0elPrq4gAeu4dkaVCuKWww==} engines: {node: ^14.13.1 || ^16 || >=18} hasBin: true @@ -7726,7 +8030,7 @@ packages: typescript: optional: true dependencies: - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) dev: true /tsconfig-paths@3.14.2: @@ -7734,7 +8038,7 @@ packages: dependencies: '@types/json5': 0.0.29 json5: 1.0.2 - minimist: 1.2.7 + minimist: 1.2.8 strip-bom: 3.0.0 dev: true @@ -7743,18 +8047,23 @@ packages: /tslib@2.5.2: resolution: {integrity: sha512-5svOrSA2w3iGFDs1HibEVBGbDrAY82bFQ3HZ3ixB+88nsbsWQoKqDRb5UBYAUPEzbBn6dAp5gRNXglySbx1MlA==} + dev: true /tslib@2.5.3: resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} - /tsutils@3.21.0(typescript@5.1.3): + /tslib@2.6.2: + resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} + dev: true + + /tsutils@3.21.0(typescript@5.1.6): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli) + typescript: 5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq) dev: true /tsx@3.12.6: @@ -7765,7 +8074,7 @@ packages: '@esbuild-kit/core-utils': 3.1.0 '@esbuild-kit/esm-loader': 2.5.5 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /tsx@3.12.7: @@ -7776,7 +8085,7 @@ packages: '@esbuild-kit/core-utils': 3.1.0 '@esbuild-kit/esm-loader': 2.5.5 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /tunnel-agent@0.6.0: @@ -7784,65 +8093,64 @@ packages: dependencies: safe-buffer: 5.2.1 - /turbo-darwin-64@1.10.1: - resolution: {integrity: sha512-isLLoPuAOMNsYovOq9BhuQOZWQuU13zYsW988KkkaA4OJqOn7qwa9V/KBYCJL8uVQqtG+/Y42J37lO8RJjyXuA==} + /turbo-darwin-64@1.10.13: + resolution: {integrity: sha512-vmngGfa2dlYvX7UFVncsNDMuT4X2KPyPJ2Jj+xvf5nvQnZR/3IeDEGleGVuMi/hRzdinoxwXqgk9flEmAYp0Xw==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64@1.10.1: - resolution: {integrity: sha512-x1nloPR10fLElNCv17BKr0kCx/O5gse/UXAcVscMZH2tvRUtXrdBmut62uw2YU3J9hli2fszYjUWXkulVpQvFA==} + /turbo-darwin-arm64@1.10.13: + resolution: {integrity: sha512-eMoJC+k7gIS4i2qL6rKmrIQGP6Wr9nN4odzzgHFngLTMimok2cGLK3qbJs5O5F/XAtEeRAmuxeRnzQwTl/iuAw==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64@1.10.1: - resolution: {integrity: sha512-abV+ODCeOlz0503OZlHhPWdy3VwJZc1jObf1VQj7uQM+JqJ/kXbMyqJIMQVz+m7QJUFdferYPRxGhYT/NbYK7Q==} + /turbo-linux-64@1.10.13: + resolution: {integrity: sha512-0CyYmnKTs6kcx7+JRH3nPEqCnzWduM0hj8GP/aodhaIkLNSAGAa+RiYZz6C7IXN+xUVh5rrWTnU2f1SkIy7Gdg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64@1.10.1: - resolution: {integrity: sha512-zRC3nZbHQ63tofOmbuySzEn1ROISWTkemYYr1L98rpmT5aVa0kERlGiYcfDwZh3cBso/Ylg/wxexRAaPzcCJYQ==} + /turbo-linux-arm64@1.10.13: + resolution: {integrity: sha512-0iBKviSGQQlh2OjZgBsGjkPXoxvRIxrrLLbLObwJo3sOjIH0loGmVIimGS5E323soMfi/o+sidjk2wU1kFfD7Q==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64@1.10.1: - resolution: {integrity: sha512-Irqz8IU+o7Q/5V44qatZBTunk+FQAOII1hZTsEU54ah62f9Y297K6/LSp+yncmVQOZlFVccXb6MDqcETExIQtA==} + /turbo-windows-64@1.10.13: + resolution: {integrity: sha512-S5XySRfW2AmnTeY1IT+Jdr6Goq7mxWganVFfrmqU+qqq3Om/nr0GkcUX+KTIo9mPrN0D3p5QViBRzulwB5iuUQ==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64@1.10.1: - resolution: {integrity: sha512-124IT15d2gyjC+NEn11pHOaVFvZDRHpxfF+LDUzV7YxfNIfV0mGkR3R/IyVXtQHOgqOdtQTbC4y411sm31+SEw==} + /turbo-windows-arm64@1.10.13: + resolution: {integrity: sha512-nKol6+CyiExJIuoIc3exUQPIBjP9nIq5SkMJgJuxsot2hkgGrafAg/izVDRDrRduQcXj2s8LdtxJHvvnbI8hEQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo@1.10.1: - resolution: {integrity: sha512-wq0YeSv6P/eEDXOL42jkMUr+T4z34dM8mdHu5u6C6OOAq8JuLJ72F/v4EVR1JmY8icyTkFz10ICLV0haUUYhbQ==} + /turbo@1.10.13: + resolution: {integrity: sha512-vOF5IPytgQPIsgGtT0n2uGZizR2N3kKuPIn4b5p5DdeLoI0BV7uNiydT7eSzdkPRpdXNnO8UwS658VaI4+YSzQ==} hasBin: true - requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.10.1 - turbo-darwin-arm64: 1.10.1 - turbo-linux-64: 1.10.1 - turbo-linux-arm64: 1.10.1 - turbo-windows-64: 1.10.1 - turbo-windows-arm64: 1.10.1 + turbo-darwin-64: 1.10.13 + turbo-darwin-arm64: 1.10.13 + turbo-linux-64: 1.10.13 + turbo-linux-arm64: 1.10.13 + turbo-windows-64: 1.10.13 + turbo-windows-arm64: 1.10.13 dev: true /tweetnacl@0.14.5: @@ -7896,16 +8204,46 @@ packages: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} dev: true + /typed-array-buffer@1.0.0: + resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-length@1.0.0: + resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + + /typed-array-byte-offset@1.0.0: + resolution: {integrity: sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + has-proto: 1.0.1 + is-typed-array: 1.1.12 + dev: true + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: call-bind: 1.0.2 for-each: 0.3.3 - is-typed-array: 1.1.10 + is-typed-array: 1.1.12 dev: true - /typescript@5.1.3(patch_hash=aeulzlcp5mwpqivdtylujgnyli): - resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==} + /typescript@5.1.6(patch_hash=nqltnu2tftypeoe37zeioxuuuq): + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -8042,7 +8380,7 @@ packages: - supports-color - terser - /vite-tsconfig-paths@4.2.0(typescript@5.1.3)(vite@4.3.9): + /vite-tsconfig-paths@4.2.0(typescript@5.1.6)(vite@4.3.9): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: vite: '*' @@ -8052,7 +8390,7 @@ packages: dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 2.1.1(typescript@5.1.3) + tsconfck: 2.1.1(typescript@5.1.6) vite: 4.3.9(@types/node@20.2.5) transitivePeerDependencies: - supports-color @@ -8089,7 +8427,7 @@ packages: postcss: 8.4.24 rollup: 3.27.2 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 /vitest@0.31.4(@vitest/ui@0.31.4): resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} @@ -8189,8 +8527,8 @@ packages: is-symbol: 1.0.4 dev: true - /which-typed-array@1.1.9: - resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + /which-typed-array@1.1.11: + resolution: {integrity: sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.5 @@ -8198,7 +8536,6 @@ packages: for-each: 0.3.3 gopd: 1.0.1 has-tostringtag: 1.0.0 - is-typed-array: 1.1.10 dev: true /which@2.0.2: @@ -8230,11 +8567,6 @@ packages: dependencies: string-width: 4.2.3 - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - dev: true - /wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} dev: true @@ -8346,13 +8678,6 @@ packages: yargs-parser: 21.1.1 dev: true - /yauzl@2.10.0: - resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} - dependencies: - buffer-crc32: 0.2.13 - fd-slicer: 1.1.0 - dev: true - /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -8364,6 +8689,10 @@ packages: /zod@3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} + /zod@3.22.2: + resolution: {integrity: sha512-wvWkphh5WQsJbVk1tbx1l1Ly4yg+XecD+Mq280uBGt9wa5BKSWf4Mhp6GmrkPixhMxmabYY7RbzlwVP32pbGCg==} + dev: true + /zx@7.2.2: resolution: {integrity: sha512-50Gjicd6ijTt7Zcz5fNX+rHrmE0uVqC+X6lYKhf2Cu8wIxDpNIzXwTmzchNdW+JY3LFsRcU43B1lHE4HBMmKgQ==} engines: {node: '>= 16.0.0'} From ee3d96da50a692de95d2a42534a1be39f2d32814 Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Thu, 24 Aug 2023 00:46:19 +0300 Subject: [PATCH 2/6] Bump package versions --- changelogs/drizzle-orm/0.28.4.md | 2 ++ changelogs/drizzle-typebox/0.1.1.md | 1 + changelogs/drizzle-valibot/0.1.1.md | 1 + changelogs/drizzle-zod/0.5.1.md | 1 + drizzle-orm/package.json | 2 +- drizzle-typebox/package.json | 2 +- drizzle-valibot/package.json | 2 +- drizzle-zod/package.json | 2 +- 8 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 changelogs/drizzle-orm/0.28.4.md create mode 100644 changelogs/drizzle-typebox/0.1.1.md create mode 100644 changelogs/drizzle-valibot/0.1.1.md create mode 100644 changelogs/drizzle-zod/0.5.1.md diff --git a/changelogs/drizzle-orm/0.28.4.md b/changelogs/drizzle-orm/0.28.4.md new file mode 100644 index 000000000..6b048ddc1 --- /dev/null +++ b/changelogs/drizzle-orm/0.28.4.md @@ -0,0 +1,2 @@ +- 🐛 Fixed imports in ESM-based projects (#1088) +- 🐛 Fixed type error on Postgres table definitions (#1089) diff --git a/changelogs/drizzle-typebox/0.1.1.md b/changelogs/drizzle-typebox/0.1.1.md new file mode 100644 index 000000000..fe0ec8bc1 --- /dev/null +++ b/changelogs/drizzle-typebox/0.1.1.md @@ -0,0 +1 @@ +- 🐛 Fixed imports in ESM projects diff --git a/changelogs/drizzle-valibot/0.1.1.md b/changelogs/drizzle-valibot/0.1.1.md new file mode 100644 index 000000000..fe0ec8bc1 --- /dev/null +++ b/changelogs/drizzle-valibot/0.1.1.md @@ -0,0 +1 @@ +- 🐛 Fixed imports in ESM projects diff --git a/changelogs/drizzle-zod/0.5.1.md b/changelogs/drizzle-zod/0.5.1.md new file mode 100644 index 000000000..fe0ec8bc1 --- /dev/null +++ b/changelogs/drizzle-zod/0.5.1.md @@ -0,0 +1 @@ +- 🐛 Fixed imports in ESM projects diff --git a/drizzle-orm/package.json b/drizzle-orm/package.json index a4e4a441c..732fe0f1a 100644 --- a/drizzle-orm/package.json +++ b/drizzle-orm/package.json @@ -1,6 +1,6 @@ { "name": "drizzle-orm", - "version": "0.28.3", + "version": "0.28.4", "description": "Drizzle ORM package for SQL databases", "type": "module", "scripts": { diff --git a/drizzle-typebox/package.json b/drizzle-typebox/package.json index 85863c704..cdeee64f9 100644 --- a/drizzle-typebox/package.json +++ b/drizzle-typebox/package.json @@ -1,6 +1,6 @@ { "name": "drizzle-typebox", - "version": "0.1.0", + "version": "0.1.1", "description": "Generate Typebox schemas from Drizzle ORM schemas", "type": "module", "scripts": { diff --git a/drizzle-valibot/package.json b/drizzle-valibot/package.json index 8edb45302..278e95a11 100644 --- a/drizzle-valibot/package.json +++ b/drizzle-valibot/package.json @@ -1,6 +1,6 @@ { "name": "drizzle-valibot", - "version": "0.1.0", + "version": "0.1.1", "description": "Generate valibot schemas from Drizzle ORM schemas", "type": "module", "scripts": { diff --git a/drizzle-zod/package.json b/drizzle-zod/package.json index db5e28ad6..df6e47325 100644 --- a/drizzle-zod/package.json +++ b/drizzle-zod/package.json @@ -1,6 +1,6 @@ { "name": "drizzle-zod", - "version": "0.5.0", + "version": "0.5.1", "description": "Generate Zod schemas from Drizzle ORM schemas", "type": "module", "scripts": { From 3c7d5f391f1bc88ee78e44e9135c9547f4748ca2 Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Thu, 24 Aug 2023 00:52:29 +0300 Subject: [PATCH 3/6] Disable new ESLint rule --- .eslintrc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index c45b9d1d3..f2fc581e6 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -65,3 +65,4 @@ rules: 'unicorn/no-process-exit': 'off' '@typescript-eslint/ban-ts-comment': 'off' '@typescript-eslint/no-empty-interface': 'off' + '@typescript-eslint/no-unsafe-declaration-merging': 'off' From e421ed53bf487c0047410b1cbdbbdd9d6600525e Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Thu, 24 Aug 2023 01:14:10 +0300 Subject: [PATCH 4/6] Fix circular dependency, fix test imports --- .eslintrc.yaml | 2 +- .../src/sqlite-core/query-builders/query-builder.ts | 2 +- drizzle-orm/src/sqlite-core/query-builders/query.ts | 2 +- .../src/sqlite-core/query-builders/select.ts | 13 ++++++------- drizzle-orm/tests/is.test.ts | 2 +- drizzle-orm/tests/tsconfig.json | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index f2fc581e6..7af1bd426 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -15,7 +15,7 @@ rules: '@typescript-eslint/consistent-type-imports': - error - disallowTypeAnnotations: false - fixStyle: inline-type-imports + fixStyle: separate-type-imports import/no-cycle: error import/no-self-import: error import/no-empty-named-blocks: error diff --git a/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts b/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts index 06d553c15..069588361 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/query-builder.ts @@ -3,7 +3,7 @@ import type { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; import { SQLiteSyncDialect } from '~/sqlite-core/dialect.ts'; import type { WithSubqueryWithSelection } from '~/sqlite-core/subquery.ts'; import { SelectionProxyHandler, WithSubquery } from '~/subquery.ts'; -import { type ColumnsSelection } from '~/view.ts'; +import type { ColumnsSelection } from '~/view.ts'; import { SQLiteSelectBuilder } from './select.ts'; import type { SelectedFields } from './select.types.ts'; diff --git a/drizzle-orm/src/sqlite-core/query-builders/query.ts b/drizzle-orm/src/sqlite-core/query-builders/query.ts index c41e770b7..0c52cfb1f 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/query.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/query.ts @@ -10,7 +10,7 @@ import { import { type SQL } from '~/sql/index.ts'; import { type KnownKeysOnly } from '~/utils.ts'; import { type SQLiteDialect } from '../dialect.ts'; -import { type PreparedQuery, type PreparedQueryConfig, type SQLiteSession } from '../session.ts'; +import type { PreparedQuery, PreparedQueryConfig, SQLiteSession } from '../session.ts'; import { type SQLiteTable } from '../table.ts'; export type SQLiteRelationalQueryKind = TMode extends 'async' diff --git a/drizzle-orm/src/sqlite-core/query-builders/select.ts b/drizzle-orm/src/sqlite-core/query-builders/select.ts index 684d7965c..31ebcf579 100644 --- a/drizzle-orm/src/sqlite-core/query-builders/select.ts +++ b/drizzle-orm/src/sqlite-core/query-builders/select.ts @@ -1,11 +1,4 @@ import { entityKind, is } from '~/entity.ts'; -import { type Placeholder, type Query, SQL } from '~/sql/index.ts'; -import type { SQLiteColumn } from '~/sqlite-core/columns/index.ts'; -import type { SQLiteDialect } from '~/sqlite-core/dialect.ts'; -import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts'; -import type { SQLiteTable } from '~/sqlite-core/table.ts'; -import { Table } from '~/table.ts'; - import { TypedQueryBuilder } from '~/query-builders/query-builder.ts'; import type { BuildSubquerySelection, @@ -17,8 +10,14 @@ import type { SelectResult, } from '~/query-builders/select.types.ts'; import { QueryPromise } from '~/query-promise.ts'; +import { type Placeholder, type Query, SQL } from '~/sql/index.ts'; +import type { SQLiteColumn } from '~/sqlite-core/columns/index.ts'; +import type { SQLiteDialect } from '~/sqlite-core/dialect.ts'; +import type { PreparedQuery, SQLiteSession } from '~/sqlite-core/session.ts'; import type { SubqueryWithSelection } from '~/sqlite-core/subquery.ts'; +import type { SQLiteTable } from '~/sqlite-core/table.ts'; import { SelectionProxyHandler, Subquery, SubqueryConfig } from '~/subquery.ts'; +import { Table } from '~/table.ts'; import { applyMixins, getTableColumns, diff --git a/drizzle-orm/tests/is.test.ts b/drizzle-orm/tests/is.test.ts index 00bf6d2d1..180f3bf88 100644 --- a/drizzle-orm/tests/is.test.ts +++ b/drizzle-orm/tests/is.test.ts @@ -1,5 +1,5 @@ import { describe, test } from 'vitest'; -import { Column, is } from '~/index'; +import { Column, is } from '~/index.ts'; import { PgArray, PgColumn, PgSerial, pgTable, serial } from '~/pg-core/index.ts'; const pgExampleTable = pgTable('test', { diff --git a/drizzle-orm/tests/tsconfig.json b/drizzle-orm/tests/tsconfig.json index 18f5dee49..d3e519834 100644 --- a/drizzle-orm/tests/tsconfig.json +++ b/drizzle-orm/tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.build.json", "compilerOptions": { "module": "esnext", "target": "esnext", From 603bbc2eebc03c6ad17bbda17648add01f71254e Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Thu, 24 Aug 2023 01:32:17 +0300 Subject: [PATCH 5/6] Remove concurrently and Promise.all from build script --- drizzle-orm/package.json | 1 - drizzle-orm/scripts/build.ts | 20 +----- drizzle-typebox/scripts/build.ts | 14 ++-- drizzle-valibot/scripts/build.ts | 14 ++-- drizzle-zod/scripts/build.ts | 14 ++-- pnpm-lock.yaml | 109 ++++++++++++++++++++++++------- 6 files changed, 105 insertions(+), 67 deletions(-) diff --git a/drizzle-orm/package.json b/drizzle-orm/package.json index 732fe0f1a..6e47af8ac 100644 --- a/drizzle-orm/package.json +++ b/drizzle-orm/package.json @@ -140,7 +140,6 @@ "@vercel/postgres": "^0.3.0", "better-sqlite3": "^8.4.0", "bun-types": "^0.6.6", - "concurrently": "^8.1.0", "cpy": "^10.1.0", "cpy-cli": "^5.0.0", "knex": "^2.4.2", diff --git a/drizzle-orm/scripts/build.ts b/drizzle-orm/scripts/build.ts index 3af0d4259..e5cf56a94 100755 --- a/drizzle-orm/scripts/build.ts +++ b/drizzle-orm/scripts/build.ts @@ -1,6 +1,5 @@ #!/usr/bin/env -S pnpm tsx import 'zx/globals'; -import concurrently from 'concurrently'; import cpy from 'cpy'; import { entries } from '../rollup.common'; @@ -46,22 +45,9 @@ function updateAndCopyPackageJson() { fs.writeJSONSync('dist.new/package.json', pkg, { spaces: 2 }); } -await concurrently([ - { - command: 'rollup --config rollup.cjs.config.ts --configPlugin typescript', - name: 'cjs', - }, - { - command: 'rollup --config rollup.esm.config.ts --configPlugin typescript', - name: 'esm', - }, - { - command: `rimraf dist-dts && tsc -p tsconfig.dts.json && resolve-tspaths -p tsconfig.dts.json --out dist-dts`, - name: 'dts', - }, -], { - killOthers: 'failure', -}).result.catch(() => process.exit(1)); +await $`rollup --config rollup.cjs.config.ts --configPlugin typescript`; +await $`rollup --config rollup.esm.config.ts --configPlugin typescript`; +await $`rimraf dist-dts && tsc -p tsconfig.dts.json && resolve-tspaths -p tsconfig.dts.json --out dist-dts`; await cpy('dist-dts/**/*.d.ts', 'dist.new', { rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), }); diff --git a/drizzle-typebox/scripts/build.ts b/drizzle-typebox/scripts/build.ts index 1791a303d..1910feac6 100755 --- a/drizzle-typebox/scripts/build.ts +++ b/drizzle-typebox/scripts/build.ts @@ -6,12 +6,10 @@ await fs.remove('dist'); await $`rollup --config rollup.config.ts --configPlugin typescript`; await $`resolve-tspaths`; await fs.copy('README.md', 'dist/README.md'); -await Promise.all([ - cpy('dist/**/*.d.ts', 'dist', { - rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), - }), - cpy('dist/**/*.d.ts', 'dist', { - rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), - }), -]); +await cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), +}); +await cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), +}); await fs.copy('package.json', 'dist/package.json'); diff --git a/drizzle-valibot/scripts/build.ts b/drizzle-valibot/scripts/build.ts index 1791a303d..1910feac6 100755 --- a/drizzle-valibot/scripts/build.ts +++ b/drizzle-valibot/scripts/build.ts @@ -6,12 +6,10 @@ await fs.remove('dist'); await $`rollup --config rollup.config.ts --configPlugin typescript`; await $`resolve-tspaths`; await fs.copy('README.md', 'dist/README.md'); -await Promise.all([ - cpy('dist/**/*.d.ts', 'dist', { - rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), - }), - cpy('dist/**/*.d.ts', 'dist', { - rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), - }), -]); +await cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), +}); +await cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), +}); await fs.copy('package.json', 'dist/package.json'); diff --git a/drizzle-zod/scripts/build.ts b/drizzle-zod/scripts/build.ts index 1791a303d..1910feac6 100755 --- a/drizzle-zod/scripts/build.ts +++ b/drizzle-zod/scripts/build.ts @@ -6,12 +6,10 @@ await fs.remove('dist'); await $`rollup --config rollup.config.ts --configPlugin typescript`; await $`resolve-tspaths`; await fs.copy('README.md', 'dist/README.md'); -await Promise.all([ - cpy('dist/**/*.d.ts', 'dist', { - rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), - }), - cpy('dist/**/*.d.ts', 'dist', { - rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), - }), -]); +await cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.mts'), +}); +await cpy('dist/**/*.d.ts', 'dist', { + rename: (basename) => basename.replace(/\.d\.ts$/, '.d.cts'), +}); await fs.copy('package.json', 'dist/package.json'); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d22f436fe..b2eaae777 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,9 +127,6 @@ importers: bun-types: specifier: ^0.6.6 version: 0.6.6 - concurrently: - specifier: ^8.1.0 - version: 8.1.0 cpy: specifier: ^10.1.0 version: 10.1.0 @@ -177,10 +174,10 @@ importers: version: 3.12.7 vite-tsconfig-paths: specifier: ^4.2.0 - version: 4.2.0(typescript@5.1.6)(vite@4.3.9) + version: 4.2.0(typescript@5.1.6) vitest: specifier: ^0.31.4 - version: 0.31.4(@vitest/ui@0.31.4) + version: 0.31.4 zod: specifier: ^3.20.2 version: 3.21.4 @@ -1514,6 +1511,7 @@ packages: /@babel/highlight@7.22.10: resolution: {integrity: sha512-78aUtVcT7MUscr0K5mIEnkwxPE0MaxkR5RxRwuHaQ+JuU5AmTPhY+do2mdzVTnIJJpyBglql2pehuBIWHug+WQ==} engines: {node: '>=6.9.0'} + requiresBuild: true dependencies: '@babel/helper-validator-identifier': 7.22.5 chalk: 2.4.2 @@ -3766,22 +3764,6 @@ packages: semver: 7.5.1 well-known-symbols: 2.0.0 - /concurrently@8.1.0: - resolution: {integrity: sha512-0AB6eOAtaW/r/kX2lCdolaWtT191ICeuJjEJvI9hT3zbPFuZ/iZaJwMRKwbuwADome7OKxk73L7od+fsveZ7tA==} - engines: {node: ^14.13.0 || >=16.0.0} - hasBin: true - dependencies: - chalk: 4.1.2 - date-fns: 2.30.0 - lodash: 4.17.21 - rxjs: 7.8.1 - shell-quote: 1.8.1 - spawn-command: 0.0.2-1 - supports-color: 8.1.1 - tree-kill: 1.2.2 - yargs: 17.7.2 - dev: true - /concurrently@8.2.1: resolution: {integrity: sha512-nVraf3aXOpIcNud5pB9M82p1tynmZkrSGQ1p6X/VY8cJ+2LMVqAgXsJxYYefACSHbTYlm92O1xuhdGTjwoEvbQ==} engines: {node: ^14.13.0 || >=16.0.0} @@ -7618,10 +7600,6 @@ packages: resolution: {integrity: sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==} dev: true - /spawn-command@0.0.2-1: - resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==} - dev: true - /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: @@ -8380,6 +8358,22 @@ packages: - supports-color - terser + /vite-tsconfig-paths@4.2.0(typescript@5.1.6): + resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} + peerDependencies: + vite: '*' + peerDependenciesMeta: + vite: + optional: true + dependencies: + debug: 4.3.4 + globrex: 0.1.2 + tsconfck: 2.1.1(typescript@5.1.6) + transitivePeerDependencies: + - supports-color + - typescript + dev: true + /vite-tsconfig-paths@4.2.0(typescript@5.1.6)(vite@4.3.9): resolution: {integrity: sha512-jGpus0eUy5qbbMVGiTxCL1iB9ZGN6Bd37VGLJU39kTDD6ZfULTTb1bcc5IeTWqWJKiWV5YihCaibeASPiGi8kw==} peerDependencies: @@ -8429,6 +8423,71 @@ packages: optionalDependencies: fsevents: 2.3.3 + /vitest@0.31.4: + resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} + engines: {node: '>=v14.18.0'} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@vitest/browser': '*' + '@vitest/ui': '*' + happy-dom: '*' + jsdom: '*' + playwright: '*' + safaridriver: '*' + webdriverio: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + playwright: + optional: true + safaridriver: + optional: true + webdriverio: + optional: true + dependencies: + '@types/chai': 4.3.5 + '@types/chai-subset': 1.3.3 + '@types/node': 20.2.5 + '@vitest/expect': 0.31.4 + '@vitest/runner': 0.31.4 + '@vitest/snapshot': 0.31.4 + '@vitest/spy': 0.31.4 + '@vitest/utils': 0.31.4 + acorn: 8.8.2 + acorn-walk: 8.2.0 + cac: 6.7.14 + chai: 4.3.7 + concordance: 5.0.4 + debug: 4.3.4 + local-pkg: 0.4.3 + magic-string: 0.30.0 + pathe: 1.1.1 + picocolors: 1.0.0 + std-env: 3.3.3 + strip-literal: 1.0.1 + tinybench: 2.5.0 + tinypool: 0.5.0 + vite: 4.3.9(@types/node@20.2.5) + vite-node: 0.31.4(@types/node@20.2.5) + why-is-node-running: 2.2.2 + transitivePeerDependencies: + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + /vitest@0.31.4(@vitest/ui@0.31.4): resolution: {integrity: sha512-GoV0VQPmWrUFOZSg3RpQAPN+LPmHg2/gxlMNJlyxJihkz6qReHDV6b0pPDcqFLNEPya4tWJ1pgwUNP9MLmUfvQ==} engines: {node: '>=v14.18.0'} From 0f1c5b4c6ea3c7084ea89a9dedc2870125836fce Mon Sep 17 00:00:00 2001 From: Dan Kochetov Date: Thu, 24 Aug 2023 01:40:51 +0300 Subject: [PATCH 6/6] Fix node-postgres ESM imports --- drizzle-orm/type-tests/kysely/index.ts | 4 +++- drizzle-orm/type-tests/pg/db.ts | 4 +++- integration-tests/tests/neon-http.test.ts | 6 ++++-- integration-tests/tests/pg-schema.test.ts | 6 ++++-- integration-tests/tests/pg.custom.test.ts | 6 ++++-- integration-tests/tests/pg.test.ts | 6 ++++-- .../issues-schemas/duplicates/pg/pg.duplicates.test.ts | 6 ++++-- .../relational/issues-schemas/wrong-mapping/pg.test.ts | 6 ++++-- integration-tests/tests/relational/pg.test.ts | 8 +++++--- 9 files changed, 35 insertions(+), 17 deletions(-) diff --git a/drizzle-orm/type-tests/kysely/index.ts b/drizzle-orm/type-tests/kysely/index.ts index ecb49810f..c6a56f572 100644 --- a/drizzle-orm/type-tests/kysely/index.ts +++ b/drizzle-orm/type-tests/kysely/index.ts @@ -1,11 +1,13 @@ import { Kysely, PostgresDialect } from 'kysely'; -import { Pool } from 'pg'; +import pg from 'pg'; import { type Equal, Expect } from 'type-tests/utils.ts'; import type { Kyselify } from '~/kysely/index.ts'; import { char, mysqlTable, timestamp as mysqlTimestamp, varchar as mysqlVarchar } from '~/mysql-core/index.ts'; import { integer, pgEnum, pgTable, serial, text, timestamp, varchar } from '~/pg-core/index.ts'; import type { PromiseOf } from '~/utils.ts'; +const { Pool } = pg; + const test = pgTable('test', { id: serial('id').primaryKey(), name: text('name').notNull(), diff --git a/drizzle-orm/type-tests/pg/db.ts b/drizzle-orm/type-tests/pg/db.ts index c9a0dd05e..8cdd30116 100644 --- a/drizzle-orm/type-tests/pg/db.ts +++ b/drizzle-orm/type-tests/pg/db.ts @@ -1,4 +1,6 @@ -import { Client } from 'pg'; +import pg from 'pg'; import { drizzle } from '~/node-postgres/index.ts'; +const { Client } = pg; + export const db = drizzle(new Client()); diff --git a/integration-tests/tests/neon-http.test.ts b/integration-tests/tests/neon-http.test.ts index acaa5b0f7..c5a7eb70e 100644 --- a/integration-tests/tests/neon-http.test.ts +++ b/integration-tests/tests/neon-http.test.ts @@ -46,10 +46,12 @@ import { varchar, } from 'drizzle-orm/pg-core'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; import { type Equal, Expect } from './utils.ts'; +const { Client } = pg; + const ENABLE_LOGGING = false; const usersTable = pgTable('users', { @@ -118,7 +120,7 @@ interface Context { docker: Docker; pgContainer: Docker.Container; db: NeonHttpDatabase; - ddlRunner: Client; + ddlRunner: pg.Client; client: NeonQueryFunction; } diff --git a/integration-tests/tests/pg-schema.test.ts b/integration-tests/tests/pg-schema.test.ts index 3e8dd27e3..f2c116805 100644 --- a/integration-tests/tests/pg-schema.test.ts +++ b/integration-tests/tests/pg-schema.test.ts @@ -22,9 +22,11 @@ import { timestamp, } from 'drizzle-orm/pg-core'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; +const { Client } = pg; + const mySchema = pgSchema('mySchema'); const usersTable = mySchema.table('users', { @@ -59,7 +61,7 @@ interface Context { docker: Docker; pgContainer: Docker.Container; db: NodePgDatabase; - client: Client; + client: pg.Client; } const test = anyTest as TestFn; diff --git a/integration-tests/tests/pg.custom.test.ts b/integration-tests/tests/pg.custom.test.ts index 8e1751816..2010d92bf 100644 --- a/integration-tests/tests/pg.custom.test.ts +++ b/integration-tests/tests/pg.custom.test.ts @@ -9,9 +9,11 @@ import { drizzle } from 'drizzle-orm/node-postgres'; import { migrate } from 'drizzle-orm/node-postgres/migrator'; import { alias, customType, pgTable, pgTableCreator, serial, text } from 'drizzle-orm/pg-core'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; +const { Client } = pg; + const customSerial = customType<{ data: number; notNull: true; default: true }>({ dataType() { return 'serial'; @@ -70,7 +72,7 @@ interface Context { docker: Docker; pgContainer: Docker.Container; db: NodePgDatabase; - client: Client; + client: pg.Client; } const test = anyTest as TestFn; diff --git a/integration-tests/tests/pg.test.ts b/integration-tests/tests/pg.test.ts index e26da3bfb..f9a50b563 100644 --- a/integration-tests/tests/pg.test.ts +++ b/integration-tests/tests/pg.test.ts @@ -48,10 +48,12 @@ import { varchar, } from 'drizzle-orm/pg-core'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; import { type Equal, Expect } from './utils.ts'; +const { Client } = pg; + const ENABLE_LOGGING = false; const usersTable = pgTable('users', { @@ -120,7 +122,7 @@ interface Context { docker: Docker; pgContainer: Docker.Container; db: NodePgDatabase; - client: Client; + client: pg.Client; } const test = anyTest as TestFn; diff --git a/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts b/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts index a28e00c8d..17a057de7 100644 --- a/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts +++ b/integration-tests/tests/relational/issues-schemas/duplicates/pg/pg.duplicates.test.ts @@ -3,11 +3,13 @@ import Docker from 'dockerode'; import { sql } from 'drizzle-orm'; import { drizzle, type NodePgDatabase } from 'drizzle-orm/node-postgres'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; import * as schema from './pg.duplicates.ts'; +const { Client } = pg; + const ENABLE_LOGGING = false; /* @@ -17,7 +19,7 @@ const ENABLE_LOGGING = false; let pgContainer: Docker.Container; let db: NodePgDatabase; -let client: Client; +let client: pg.Client; async function createDockerDB(): Promise { const docker = new Docker(); diff --git a/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts b/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts index 35e2b388f..ea81c82fb 100644 --- a/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts +++ b/integration-tests/tests/relational/issues-schemas/wrong-mapping/pg.test.ts @@ -3,11 +3,13 @@ import Docker from 'dockerode'; import { desc, sql } from 'drizzle-orm'; import { drizzle, type NodePgDatabase } from 'drizzle-orm/node-postgres'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expectTypeOf, test } from 'vitest'; import * as schema from './pg.schema.ts'; +const { Client } = pg; + const ENABLE_LOGGING = false; /* @@ -17,7 +19,7 @@ const ENABLE_LOGGING = false; let pgContainer: Docker.Container; let db: NodePgDatabase; -let client: Client; +let client: pg.Client; async function createDockerDB(): Promise { const docker = new Docker(); diff --git a/integration-tests/tests/relational/pg.test.ts b/integration-tests/tests/relational/pg.test.ts index ceca76036..02f7fcbec 100644 --- a/integration-tests/tests/relational/pg.test.ts +++ b/integration-tests/tests/relational/pg.test.ts @@ -3,11 +3,13 @@ import Docker from 'dockerode'; import { desc, DrizzleError, eq, gt, gte, or, placeholder, sql, TransactionRollbackError } from 'drizzle-orm'; import { drizzle, type NodePgDatabase } from 'drizzle-orm/node-postgres'; import getPort from 'get-port'; -import { Client } from 'pg'; +import pg from 'pg'; import { v4 as uuid } from 'uuid'; import { afterAll, beforeAll, beforeEach, expect, expectTypeOf, test } from 'vitest'; import * as schema from './pg.schema.ts'; +const { Client } = pg; + const { usersTable, postsTable, commentsTable, usersToGroupsTable, groupsTable } = schema; const ENABLE_LOGGING = false; @@ -22,14 +24,14 @@ declare module 'vitest' { docker: Docker; pgContainer: Docker.Container; pgDb: NodePgDatabase; - pgClient: Client; + pgClient: pg.Client; } } let globalDocker: Docker; let pgContainer: Docker.Container; let db: NodePgDatabase; -let client: Client; +let client: pg.Client; async function createDockerDB(): Promise { const docker = (globalDocker = new Docker());