Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vercel postgres #2103

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelogs/drizzle-orm/0.30.7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Bug fixes

- Add mappings for `@vercel/postgres` package
- Fix interval mapping for `neon` drivers - #1542
10 changes: 5 additions & 5 deletions drizzle-orm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "drizzle-orm",
"version": "0.30.6",
"version": "0.30.7",
"description": "Drizzle ORM package for SQL databases",
"type": "module",
"scripts": {
Expand Down Expand Up @@ -45,6 +45,7 @@
"peerDependencies": {
"@aws-sdk/client-rds-data": ">=3",
"@cloudflare/workers-types": ">=3",
"@electric-sql/pglite": ">=0.1.1",
"@libsql/client": "*",
"@neondatabase/serverless": ">=0.1",
"@op-engineering/op-sqlite": ">=2",
Expand All @@ -54,7 +55,7 @@
"@types/pg": "*",
"@types/react": ">=18",
"@types/sql.js": "*",
"@vercel/postgres": "*",
"@vercel/postgres": ">=0.8.0",
"@xata.io/client": "*",
"better-sqlite3": ">=7",
"bun-types": "*",
Expand All @@ -66,8 +67,7 @@
"postgres": ">=3",
"react": ">=18",
"sql.js": ">=1",
"sqlite3": ">=5",
"@electric-sql/pglite": ">=0.1.1"
"sqlite3": ">=5"
},
"peerDependenciesMeta": {
"mysql2": {
Expand Down Expand Up @@ -161,7 +161,7 @@
"@types/pg": "^8.10.1",
"@types/react": "^18.2.45",
"@types/sql.js": "^1.4.4",
"@vercel/postgres": "^0.3.0",
"@vercel/postgres": "^0.8.0",
"@xata.io/client": "^0.29.3",
"better-sqlite3": "^8.4.0",
"bun-types": "^0.6.6",
Expand Down
1 change: 1 addition & 0 deletions drizzle-orm/src/neon-serverless/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class NeonDriver {
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
types.setTypeParser(types.builtins.TIMESTAMP, (val) => val);
types.setTypeParser(types.builtins.DATE, (val) => val);
types.setTypeParser(types.builtins.INTERVAL, (val) => val);
}
}

Expand Down
8 changes: 5 additions & 3 deletions drizzle-orm/src/vercel-postgres/driver.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { types } from '@vercel/postgres';
import { entityKind } from '~/entity.ts';
import type { Logger } from '~/logger.ts';
import { DefaultLogger } from '~/logger.ts';
Expand Down Expand Up @@ -34,9 +35,10 @@ export class VercelPgDriver {
}

initMappers() {
// types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
// types.setTypeParser(types.builtins.TIMESTAMP, (val) => val);
// types.setTypeParser(types.builtins.DATE, (val) => val);
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
types.setTypeParser(types.builtins.TIMESTAMP, (val) => val);
types.setTypeParser(types.builtins.DATE, (val) => val);
types.setTypeParser(types.builtins.INTERVAL, (val) => val);
}
}

Expand Down
50 changes: 46 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading