Skip to content

Commit

Permalink
fix(db-postgres, db-sqlite)!: bump drizzle-kit drizzle-orm @libsql/cl…
Browse files Browse the repository at this point in the history
…ient (#8617)

Inheriting all the fixes from drizzle moving to latest versions

## BREAKING CHANGES
If you have a prior version of @libsql/client installed in your project,
you must upgrade to 0.14.0
  • Loading branch information
DanRibbens authored Oct 15, 2024
1 parent 8d10737 commit 93545f3
Show file tree
Hide file tree
Showing 12 changed files with 166 additions and 128 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
},
"devDependencies": {
"@jest/globals": "29.7.0",
"@libsql/client": "0.6.2",
"@libsql/client": "0.14.0",
"@next/bundle-analyzer": "15.0.0-canary.173",
"@payloadcms/db-postgres": "workspace:*",
"@payloadcms/eslint-config": "workspace:*",
Expand Down Expand Up @@ -132,8 +132,8 @@
"create-payload-app": "workspace:*",
"cross-env": "7.0.3",
"dotenv": "16.4.5",
"drizzle-kit": "0.23.2-df9e596",
"drizzle-orm": "0.32.1",
"drizzle-kit": "0.26.0",
"drizzle-orm": "0.35.0",
"escape-html": "^1.0.3",
"execa": "5.1.1",
"form-data": "3.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/db-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"@payloadcms/drizzle": "workspace:*",
"@types/pg": "8.10.2",
"console-table-printer": "2.11.2",
"drizzle-kit": "0.23.2-df9e596",
"drizzle-orm": "0.32.1",
"drizzle-kit": "0.26.0",
"drizzle-orm": "0.35.0",
"pg": "8.11.3",
"prompts": "2.4.2",
"to-snake-case": "1.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/db-sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"prepublishOnly": "pnpm clean && pnpm turbo build"
},
"dependencies": {
"@libsql/client": "^0.6.2",
"@libsql/client": "0.14.0",
"@payloadcms/drizzle": "workspace:*",
"console-table-printer": "2.11.2",
"drizzle-kit": "0.23.2-df9e596",
"drizzle-orm": "0.32.1",
"drizzle-kit": "0.26.0",
"drizzle-orm": "0.35.0",
"prompts": "2.4.2",
"to-snake-case": "1.0.0",
"uuid": "9.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/db-sqlite/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const connect: Connect = async function connect(
}

const logger = this.logger || false
this.drizzle = drizzle(this.client, { logger, schema: this.schema }) as LibSQLDatabase
this.drizzle = drizzle(this.client, { logger, schema: this.schema })

if (!hotReload) {
if (process.env.PAYLOAD_DROP_DATABASE === 'true') {
Expand Down
1 change: 1 addition & 0 deletions packages/db-sqlite/src/defaultSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export const defaultDrizzleSnapshot: DrizzleSQLiteSnapshotJSON = {
prevId: '00000000-0000-0000-0000-00000000000',
tables: {},
version: '6',
views: {},
}
4 changes: 3 additions & 1 deletion packages/db-sqlite/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ export type SQLiteAdapter = {
countDistinct: CountDistinct
defaultDrizzleSnapshot: any
deleteWhere: DeleteWhere
drizzle: LibSQLDatabase
drizzle: { $client: Client } & LibSQLDatabase<
Record<string, GenericRelation | GenericTable> & Record<string, unknown>
>
dropDatabase: DropDatabase
execute: Execute<unknown>
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/db-vercel-postgres/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"@payloadcms/drizzle": "workspace:*",
"@vercel/postgres": "^0.9.0",
"console-table-printer": "2.11.2",
"drizzle-kit": "0.23.2-df9e596",
"drizzle-orm": "0.32.1",
"drizzle-kit": "0.26.0",
"drizzle-orm": "0.35.0",
"pg": "8.11.3",
"prompts": "2.4.2",
"to-snake-case": "1.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/drizzle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
},
"dependencies": {
"console-table-printer": "2.11.2",
"drizzle-orm": "0.32.1",
"drizzle-orm": "0.34.1-1f15bfd",
"prompts": "2.4.2",
"to-snake-case": "1.0.0",
"uuid": "9.0.0"
},
"devDependencies": {
"@libsql/client": "^0.6.2",
"@libsql/client": "0.14.0",
"@payloadcms/eslint-config": "workspace:*",
"@types/pg": "8.10.2",
"@types/to-snake-case": "1.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/drizzle/src/postgres/defaultSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export const defaultDrizzleSnapshot: DrizzleSnapshotJSON = {
sequences: {},
tables: {},
version: '7',
views: {},
}
4 changes: 2 additions & 2 deletions packages/drizzle/src/postgres/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export type CreateDatabase = (args?: {
type Schema =
| {
enum: typeof pgEnum
table: PgTableFn
table: PgTableFn<string>
}
| PgSchema

Expand Down Expand Up @@ -149,7 +149,7 @@ export type BasePostgresAdapter = {
localesSuffix?: string
logger: DrizzleConfig['logger']
operators: Operators
pgSchema?: Schema
pgSchema: Schema
poolOptions?: ClientConfig
prodMigrations?: {
down: (args: MigrateDownArgs) => Promise<void>
Expand Down
256 changes: 145 additions & 111 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"comment-json": "^4.2.3",
"create-payload-app": "workspace:*",
"dotenv": "16.4.5",
"drizzle-kit": "0.23.2-df9e596",
"drizzle-kit": "0.26.0",
"eslint-plugin-playwright": "1.6.2",
"execa": "5.1.1",
"file-type": "19.3.0",
Expand Down

0 comments on commit 93545f3

Please sign in to comment.