Skip to content

Commit

Permalink
Merge branch 'main' into integration/fix-sqlite-d1-max-bind-values
Browse files Browse the repository at this point in the history
  • Loading branch information
jkomyno committed May 31, 2024
2 parents 12c8fb3 + 729c664 commit 4d058ed
Show file tree
Hide file tree
Showing 244 changed files with 3,816 additions and 1,787 deletions.
16 changes: 11 additions & 5 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@
"matchFileNames": ["packages/client/tests/e2e/ts-version/**"],
"schedule": ["before 7am on Wednesday"]
},
{
"groupName": "Weekly vitess docker image version update",
"matchPackageNames": ["vitess/vttestserver"],
"schedule": ["before 7am on Wednesday"]
},
{
"groupName": "Extension: Accelerate",
"automerge": true,
Expand Down Expand Up @@ -260,6 +255,17 @@
"@types/pg"
],
"schedule": ["before 7am on Wednesday"]
},
{
"groupName": "Vitess Docker image",
"matchDatasources": ["docker"],
"matchPackageNames": ["vitess/vttestserver"],
"schedule": ["before 7am on Wednesday"]
},
{
"groupName": "MySQL Docker image",
"matchDatasources": ["docker"],
"matchPackageNames": ["mysql"]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/lint-workflow-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
# see https://github.com/rhysd/actionlint/blob/main/docs/usage.md
- name: Check workflow files
# https://hub.docker.com/r/rhysd/actionlint/tags
uses: docker://rhysd/actionlint:1.7.0
uses: docker://rhysd/actionlint:1.7.1
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ services:
# Planetscale
# From https://github.com/prisma/prisma-engines/blob/976a00ae3c30ab9507fa742986c9c6f5327ba10f/docker-compose.yml
vitess-8:
image: vitess/vttestserver:mysql80@sha256:80d7a5af966f45d8579408f35ba31a434d99b6a56fab3597c5707e26c476b2eb
image: vitess/vttestserver:mysql80@sha256:61c67c927f22be141b41846a0c4101d5b61729c722777ec306a22bada0575999
restart: unless-stopped
ports:
- 33807:33807
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"bundle-size": "pnpm i && pnpm -r dev && pnpm -r --parallel exec pnpm pack && cd packages/bundle-size && pnpm run create-gzip-files"
},
"devDependencies": {
"@microsoft/api-extractor": "7.43.2",
"@microsoft/api-extractor": "7.46.2",
"@prisma/engines": "workspace:*",
"@sindresorhus/slugify": "1.1.2",
"@size-limit/file": "9.0.0",
Expand All @@ -42,16 +42,16 @@
"@types/node": "20.12.7",
"@types/redis": "2.8.32",
"@types/resolve": "1.20.6",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"@typescript-eslint/utils": "7.9.0",
"@typescript-eslint/eslint-plugin": "7.11.0",
"@typescript-eslint/parser": "7.11.0",
"@typescript-eslint/utils": "7.11.0",
"arg": "5.0.2",
"batching-toposort": "1.2.0",
"buffer": "6.0.3",
"chokidar": "3.6.0",
"decimal.js-light": "2.5.1",
"dotenv-cli": "7.4.2",
"esbuild": "0.21.2",
"esbuild": "0.21.4",
"esbuild-register": "3.5.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
Expand All @@ -70,7 +70,7 @@
"is-ci": "3.0.1",
"jest-junit": "16.0.0",
"kleur": "4.1.5",
"lint-staged": "15.2.2",
"lint-staged": "15.2.5",
"p-map": "4.0.0",
"p-reduce": "2.1.0",
"p-retry": "4.6.2",
Expand All @@ -80,14 +80,14 @@
"regenerator-runtime": "0.14.1",
"resolve": "1.22.8",
"safe-buffer": "5.2.1",
"semver": "7.6.1",
"semver": "7.6.2",
"size-limit": "9.0.0",
"spdx-exceptions": "2.5.0",
"spdx-license-ids": "3.0.17",
"spdx-license-ids": "3.0.18",
"staged-git-files": "1.3.0",
"ts-node": "10.9.2",
"ts-toolbelt": "9.6.0",
"tsx": "4.10.1",
"tsx": "4.11.0",
"typescript": "5.4.5",
"zx": "7.2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-d1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"sideEffects": false,
"dependencies": {
"@prisma/driver-adapter-utils": "workspace:*",
"@cloudflare/workers-types": "4.20240512.0"
"@cloudflare/workers-types": "4.20240529.0"
},
"devDependencies": {},
"peerDependencies": {}
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-libsql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"async-mutex": "0.5.0"
},
"devDependencies": {
"@libsql/client": "0.6.0"
"@libsql/client": "0.6.1"
},
"peerDependencies": {
"@libsql/client": "^0.3.5 || ^0.4.0 || ^0.5.0 || ^0.6.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-neon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"postgres-array": "3.0.2"
},
"devDependencies": {
"@neondatabase/serverless": "0.9.1",
"@swc/core": "1.5.3",
"@neondatabase/serverless": "0.9.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"jest": "29.7.0",
"jest-junit": "16.0.0"
Expand Down
15 changes: 5 additions & 10 deletions packages/adapter-neon/src/conversion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { types } from '@neondatabase/serverless'
import { type ColumnType, ColumnTypeEnum, JsonNullMarker } from '@prisma/driver-adapter-utils'
import { type ColumnType, ColumnTypeEnum } from '@prisma/driver-adapter-utils'
import { parse as parseArray } from 'postgres-array'

const ScalarColumnType = types.builtins
Expand Down Expand Up @@ -342,17 +342,12 @@ types.setTypeParser(ArrayColumnType.MONEY_ARRAY, normalize_array(normalize_money
/*****************/

/**
* JsonNull are stored in JSON strings as the string "null", distinguishable from
* the `null` value which is used by the driver to represent the database NULL.
* By default, JSON and JSONB columns use JSON.parse to parse a JSON column value
* and this will lead to serde_json::Value::Null in Rust, which will be interpreted
* as DbNull.
*
* By converting "null" to JsonNullMarker, we can signal JsonNull in Rust side and
* convert it to QuaintValue::Json(Some(Null)).
* We hand off JSON handling entirely to engines, so we keep it
* stringified here. This function needs to exist as otherwise
* the default type parser attempts to deserialise it.
*/
function toJson(json: string): unknown {
return json === 'null' ? JsonNullMarker : JSON.parse(json)
return json
}

types.setTypeParser(ScalarColumnType.JSONB, toJson)
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-pg-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
"devDependencies": {
"@prisma/pg-worker": "workspace:*",
"@swc/core": "1.5.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"jest": "29.7.0",
"jest-junit": "16.0.0"
Expand Down
15 changes: 5 additions & 10 deletions packages/adapter-pg-worker/src/conversion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ColumnType, ColumnTypeEnum, JsonNullMarker } from '@prisma/driver-adapter-utils'
import { type ColumnType, ColumnTypeEnum } from '@prisma/driver-adapter-utils'
import * as pg from '@prisma/pg-worker'
import { parse as parseArray } from 'postgres-array'

Expand Down Expand Up @@ -343,17 +343,12 @@ setTypeParser(ArrayColumnType.MONEY_ARRAY, normalize_array(normalize_money))
/*****************/

/**
* JsonNull are stored in JSON strings as the string "null", distinguishable from
* the `null` value which is used by the driver to represent the database NULL.
* By default, JSON and JSONB columns use JSON.parse to parse a JSON column value
* and this will lead to serde_json::Value::Null in Rust, which will be interpreted
* as DbNull.
*
* By converting "null" to JsonNullMarker, we can signal JsonNull in Rust side and
* convert it to QuaintValue::Json(Some(Null)).
* We hand off JSON handling entirely to engines, so we keep it
* stringified here. This function needs to exist as otherwise
* the default type parser attempts to deserialise it.
*/
function toJson(json: string): unknown {
return json === 'null' ? JsonNullMarker : JSON.parse(json)
return json
}

setTypeParser(ScalarColumnType.JSONB, toJson)
Expand Down
4 changes: 2 additions & 2 deletions packages/adapter-pg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"postgres-array": "3.0.2"
},
"devDependencies": {
"@swc/core": "1.5.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"@types/pg": "8.11.5",
"@types/pg": "8.11.6",
"jest": "29.7.0",
"jest-junit": "16.0.0",
"pg": "8.11.5"
Expand Down
15 changes: 5 additions & 10 deletions packages/adapter-pg/src/conversion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ColumnType, ColumnTypeEnum, JsonNullMarker } from '@prisma/driver-adapter-utils'
import { type ColumnType, ColumnTypeEnum } from '@prisma/driver-adapter-utils'
// @ts-ignore: this is used to avoid the `Module '"<path>/node_modules/@types/pg/index"' has no default export.` error.
import pg from 'pg'
import { parse as parseArray } from 'postgres-array'
Expand Down Expand Up @@ -344,17 +344,12 @@ setTypeParser(ArrayColumnType.MONEY_ARRAY, normalize_array(normalize_money))
/*****************/

/**
* JsonNull are stored in JSON strings as the string "null", distinguishable from
* the `null` value which is used by the driver to represent the database NULL.
* By default, JSON and JSONB columns use JSON.parse to parse a JSON column value
* and this will lead to serde_json::Value::Null in Rust, which will be interpreted
* as DbNull.
*
* By converting "null" to JsonNullMarker, we can signal JsonNull in Rust side and
* convert it to QuaintValue::Json(Some(Null)).
* We hand off JSON handling entirely to engines, so we keep it
* stringified here. This function needs to exist as otherwise
* the default type parser attempts to deserialise it.
*/
function toJson(json: string): unknown {
return json === 'null' ? JsonNullMarker : JSON.parse(json)
return json
}

setTypeParser(ScalarColumnType.JSONB, toJson)
Expand Down
2 changes: 1 addition & 1 deletion packages/adapter-planetscale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"devDependencies": {
"@planetscale/database": "1.18.0",
"@swc/core": "1.5.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"jest": "29.7.0",
"jest-junit": "16.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/adapter-planetscale/src/conversion.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cast as defaultCast } from '@planetscale/database'
import { type ColumnType, ColumnTypeEnum, JsonNullMarker } from '@prisma/driver-adapter-utils'
import { type ColumnType, ColumnTypeEnum } from '@prisma/driver-adapter-utils'

// See: https://github.com/planetscale/vitess-types/blob/06235e372d2050b4c0fff49972df8111e696c564/src/vitess/query/v16/query.proto#L108-L218
export type PlanetScaleColumnType =
Expand Down Expand Up @@ -98,8 +98,8 @@ export function fieldToColumnType(field: PlanetScaleColumnType): ColumnType {
}

export const cast: typeof defaultCast = (field, value) => {
if (field.type === 'JSON' && value === 'null') {
return JsonNullMarker
if (field.type === 'JSON') {
return value
}

const defaultValue = defaultCast(field, value)
Expand Down
10 changes: 9 additions & 1 deletion packages/bundle-size/create-gzip-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ void (async () => {

await $`pnpm install` // needs this for `pnpm prisma`

await $`pnpm list -r --depth -2` // print the versions of the dependencies installed

for (const project of projects) {
// `nodejs_compat` is only needed when using `pg`
const compatFlags = project === 'da-workers-pg-worker' ? 'nodejs_compat' : ''
Expand All @@ -34,7 +36,13 @@ void (async () => {
await $`rm -rf ${projectDir}/output.tgz`

// Use wrangler to generate the function output
await $`pnpm wrangler deploy ${projectDir}/index.js --dry-run --outdir=${projectDir}/output --compatibility-date 2024-01-26 --compatibility-flags [${compatFlags}] ${nodeCompat} --name ${project} --tsconfig ${__dirname}/tsconfig.json`
await $`pnpm wrangler deploy ${projectDir}/index.js \
--dry-run \
--outdir=${projectDir}/output \
--compatibility-date 2024-01-26 \
--compatibility-flags [${compatFlags}] ${nodeCompat} \
--name ${project} \
--tsconfig ${__dirname}/tsconfig.json`

// Delete *.js.map & Markdown files
await $`rm ${projectDir}/output/*.js.map`
Expand Down
4 changes: 2 additions & 2 deletions packages/bundle-size/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Pierre-Antoine Mills",
"license": "Apache-2.0",
"dependencies": {
"@libsql/client": "0.6.0",
"@libsql/client": "0.6.1",
"@neondatabase/serverless": "0.9.3",
"@planetscale/database": "1.18.0",
"@prisma/adapter-neon": "workspace:*",
Expand All @@ -22,6 +22,6 @@
"@prisma/adapter-pg-worker": "workspace:*",
"pg": "8.11.5",
"prisma": "workspace:*",
"wrangler": "3.56.0"
"wrangler": "3.57.2"
}
}
4 changes: 2 additions & 2 deletions packages/bundled-js-drivers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"build": "tsx helpers/build.ts"
},
"dependencies": {
"@libsql/client": "0.6.0",
"@libsql/client": "0.6.1",
"@neondatabase/serverless": "0.9.3",
"@planetscale/database": "1.18.0",
"@types/pg": "8.11.5",
"@types/pg": "8.11.6",
"pg": "8.11.5"
}
}
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@prisma/mini-proxy": "0.9.5",
"@prisma/studio": "0.500.0",
"@prisma/studio-server": "0.500.0",
"@swc/core": "1.5.3",
"@swc/core": "1.5.7",
"@swc/jest": "0.2.36",
"@types/debug": "4.1.12",
"@types/fs-extra": "9.0.13",
Expand All @@ -90,7 +90,7 @@
"checkpoint-client": "1.1.33",
"debug": "4.3.4",
"dotenv": "16.0.3",
"esbuild": "0.21.2",
"esbuild": "0.21.4",
"execa": "5.1.1",
"fast-glob": "3.3.2",
"fs-extra": "11.1.1",
Expand All @@ -109,7 +109,7 @@
"resolve-pkg": "2.0.0",
"rimraf": "3.0.2",
"strip-ansi": "6.0.1",
"ts-pattern": "5.1.1",
"ts-pattern": "5.1.2",
"typescript": "5.4.5",
"xdg-app-paths": "8.3.0",
"zx": "7.2.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/DebugInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Command } from '@prisma/internals'
import {
arg,
format,
getSchemaPath,
getSchemaWithPath,
HelpError,
isCi,
isError,
Expand Down Expand Up @@ -65,7 +65,7 @@ export class DebugInfo implements Command {

let schemaPath
try {
schemaPath = link((await getSchemaPath(args['--schema']))?.schemaPath)
schemaPath = link((await getSchemaWithPath(args['--schema']))?.schemaPath)
} catch (e) {
schemaPath = e.message
}
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/Version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
getConfig,
getEnginesMetaInfo,
getSchema,
getSchemaPath,
getSchemaWithPath,
HelpError,
isError,
loadEnvFile,
Expand Down Expand Up @@ -113,7 +113,7 @@ export class Version implements Command {
enginesMetaInfoErrors.forEach((e) => console.error(e))
}

const schemaPath = (await getSchemaPath())?.schemaPath ?? null
const schemaPath = (await getSchemaWithPath())?.schemaPath ?? null
const featureFlags = await this.getFeatureFlags(schemaPath)
if (featureFlags && featureFlags.length > 0) {
rows.push(['Preview Features', featureFlags.join(', ')])
Expand Down

0 comments on commit 4d058ed

Please sign in to comment.