diff --git a/changelogs/drizzle-orm-pg/0.13.3.md b/changelogs/drizzle-orm-pg/0.13.3.md index fdeb0c791..bb0c9ce1b 100644 --- a/changelogs/drizzle-orm-pg/0.13.3.md +++ b/changelogs/drizzle-orm-pg/0.13.3.md @@ -1,4 +1,4 @@ -# drizzle-orm-pg 0.13.3-beta.1 +# drizzle-orm-pg 0.13.3 - Implemented NeonDB serverless driver support. - (internal) Added `session.all()` and `session.values()` methods. diff --git a/drizzle-orm-pg/package.json b/drizzle-orm-pg/package.json index 62f844be8..fa2c23a6a 100644 --- a/drizzle-orm-pg/package.json +++ b/drizzle-orm-pg/package.json @@ -1,6 +1,6 @@ { "name": "drizzle-orm-pg", - "version": "0.13.3-beta.1", + "version": "0.13.3-beta.2", "description": "Drizzle ORM package for PostgreSQL database", "main": "index.js", "types": "index.d.ts", diff --git a/drizzle-orm-pg/src/db.ts b/drizzle-orm-pg/src/db.ts index 093b995a0..cd479d8f3 100644 --- a/drizzle-orm-pg/src/db.ts +++ b/drizzle-orm-pg/src/db.ts @@ -1,4 +1,4 @@ -import { SQL, SQLWrapper } from 'drizzle-orm/sql'; +import { SQLWrapper } from 'drizzle-orm/sql'; import { QueryResult, QueryResultRow } from 'pg'; import { PgDialect } from '~/dialect'; diff --git a/drizzle-orm-pg/src/neondb-serverless/connector.ts b/drizzle-orm-pg/src/neondb/connector.ts similarity index 89% rename from drizzle-orm-pg/src/neondb-serverless/connector.ts rename to drizzle-orm-pg/src/neondb/connector.ts index b1574c46f..c55c78210 100644 --- a/drizzle-orm-pg/src/neondb-serverless/connector.ts +++ b/drizzle-orm-pg/src/neondb/connector.ts @@ -1,6 +1,6 @@ import { Logger, MigrationConfig, readMigrationFiles } from 'drizzle-orm'; +import { PgDatabase } from '~/db'; import { PgDialect } from '~/dialect'; -import { PgSession } from '~/session'; import { NeonDriver } from './driver'; import { NeonClient, NeonSession } from './session'; @@ -10,6 +10,8 @@ export interface PgConnectorOptions { driver?: NeonDriver; } +export type NeonDatabase = PgDatabase; + export class NeonConnector { dialect: PgDialect; driver: NeonDriver; @@ -24,7 +26,7 @@ export class NeonConnector { return this.session ?? (this.session = await this.driver.connect()); } - async connect() { + async connect(): Promise { const session = await this.getSession(); return this.dialect.createDB(session); } diff --git a/drizzle-orm-pg/src/neondb-serverless/driver.ts b/drizzle-orm-pg/src/neondb/driver.ts similarity index 100% rename from drizzle-orm-pg/src/neondb-serverless/driver.ts rename to drizzle-orm-pg/src/neondb/driver.ts diff --git a/drizzle-orm-pg/src/neondb-serverless/index.ts b/drizzle-orm-pg/src/neondb/index.ts similarity index 100% rename from drizzle-orm-pg/src/neondb-serverless/index.ts rename to drizzle-orm-pg/src/neondb/index.ts diff --git a/drizzle-orm-pg/src/neondb-serverless/session.ts b/drizzle-orm-pg/src/neondb/session.ts similarity index 100% rename from drizzle-orm-pg/src/neondb-serverless/session.ts rename to drizzle-orm-pg/src/neondb/session.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a44a33864..e40347b25 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,7 +97,7 @@ importers: dependencies: better-sqlite3: 7.6.2 dockerode: 3.3.4 - drizzle-orm: file:drizzle-orm/package.tgz_ccm5oiaymt2bpo3es3enxw7nvq + drizzle-orm: file:drizzle-orm/package.tgz_fa46nzpunvoquqxhugzea2mbey drizzle-orm-pg: file:drizzle-orm-pg/package.tgz_7uaqoqlqwntcydaaydjwuvx4re drizzle-orm-sqlite: file:drizzle-orm-sqlite/package.tgz_xrn2ihivq2crdlwls673trjs6q get-port: 6.1.2 @@ -3126,10 +3126,10 @@ packages: dev: true file:drizzle-orm-pg/package.tgz_7uaqoqlqwntcydaaydjwuvx4re: - resolution: {integrity: sha512-8KnwDL6xgrX7awVA4m5Nb3E6sxbj37uyF3QgNh4+3E+1EbMi2naHk9AEbMp5F1qW1EPN/nv7NmSRHCgjcJvITQ==, tarball: file:drizzle-orm-pg/package.tgz} + resolution: {integrity: sha512-+9wz5PKbm3aLSrURKeDBvQio5PppIGNq7TQ9k8u7WdkJC3o397gSWeHxVDVGtfHljAyZXQOhovoUIjV1DOqifg==, tarball: file:drizzle-orm-pg/package.tgz} id: file:drizzle-orm-pg/package.tgz name: drizzle-orm-pg - version: 0.13.2 + version: 0.13.3-beta.1 peerDependencies: '@types/pg': '>=8 <9' drizzle-orm: '>=0.13.0 <0.14.0 || >=0.13.0-beta.0 <0.14.0-beta.0' @@ -3141,7 +3141,7 @@ packages: optional: true dependencies: '@types/pg': 8.6.5 - drizzle-orm: file:drizzle-orm/package.tgz_ccm5oiaymt2bpo3es3enxw7nvq + drizzle-orm: file:drizzle-orm/package.tgz_fa46nzpunvoquqxhugzea2mbey pg: 8.8.0 dev: false @@ -3168,11 +3168,11 @@ packages: dependencies: '@types/better-sqlite3': 7.6.2 better-sqlite3: 7.6.2 - drizzle-orm: file:drizzle-orm/package.tgz_ccm5oiaymt2bpo3es3enxw7nvq + drizzle-orm: file:drizzle-orm/package.tgz_fa46nzpunvoquqxhugzea2mbey sqlite3: 5.1.2 dev: false - file:drizzle-orm/package.tgz_ccm5oiaymt2bpo3es3enxw7nvq: + file:drizzle-orm/package.tgz_fa46nzpunvoquqxhugzea2mbey: resolution: {integrity: sha512-6jEkpF36JX6DOu/iecXapA3DFibVTa+WmV0EbXFXah4Qz7JDNnoLNilDa1EcgLPWR/lisMDm7T5aMFsLz4eVQA==, tarball: file:drizzle-orm/package.tgz} id: file:drizzle-orm/package.tgz name: drizzle-orm