Skip to content

Commit

Permalink
Merge branch 'main' into fix/dont-query-check-constraints-on-mysql-8.…
Browse files Browse the repository at this point in the history
…0.15-and-below
  • Loading branch information
jkomyno authored Jan 22, 2024
2 parents dacf873 + c71605d commit f171d68
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ mod max_integer {
schema.to_owned()
}

// Info: `driver-adapters` are currently excluded because they yield a different error message,
// coming straight from the database.
#[connector_test(
schema(overflow_pg),
only(Postgres),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ mod bigint {
}

// "Using a BigInt field" should "work"
#[connector_test(exclude(
Postgres("pg.js.wasm", "neon.js.wasm"),
Sqlite("libsql.js.wasm"),
Vitess("planetscale.js.wasm")
))]
#[connector_test()]
async fn using_bigint_field(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod postgres {
}

//"Postgres native int types" should "work"
#[connector_test(schema(schema_int), only(Postgres), exclude(Postgres("pg.js.wasm", "neon.js.wasm")))]
#[connector_test(schema(schema_int), only(Postgres))]
async fn native_int_types(runner: Runner) -> TestResult<()> {
insta::assert_snapshot!(
run_query!(&runner, r#"mutation {
Expand Down
2 changes: 1 addition & 1 deletion query-engine/driver-adapters/executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@libsql/client": "0.3.6",
"@neondatabase/serverless": "0.7.2",
"@planetscale/database": "1.13.0",
"@planetscale/database": "1.14.0",
"query-engine-wasm-latest": "npm:@prisma/query-engine-wasm@latest",
"query-engine-wasm-baseline": "npm:@prisma/[email protected]",
"@prisma/adapter-libsql": "workspace:*",
Expand Down
2 changes: 0 additions & 2 deletions query-engine/driver-adapters/executor/src/testd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { Client as PlanetscaleClient } from '@planetscale/database'
import { PrismaPlanetScale } from '@prisma/adapter-planetscale'



import {bindAdapter, DriverAdapter, ErrorCapturingDriverAdapter} from "@prisma/driver-adapter-utils";
import { webcrypto } from 'node:crypto';

Expand Down Expand Up @@ -292,7 +291,6 @@ async function planetscaleAdapter(url: string): Promise<DriverAdapter> {
throw new Error("DRIVER_ADAPTER_CONFIG is not defined or empty, but its required for planetscale adapter.");
}


const client = new PlanetscaleClient({
// preserving path name so proxy url would look like real DB url
url: copyPathName(url, proxyUrl),
Expand Down
11 changes: 7 additions & 4 deletions query-engine/driver-adapters/src/wasm/to_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ use serde::Serialize;
use serde_wasm_bindgen::Serializer;
use wasm_bindgen::{JsError, JsValue};

// `serialize_missing_as_null` is required to make sure that "empty" values (e.g., `None` and `()`)
// are serialized as `null` and not `undefined`.
// This is due to certain drivers (e.g., LibSQL) not supporting `undefined` values.
static DEFAULT_SERIALIZER: Serializer = Serializer::new().serialize_missing_as_null(true);
// - `serialize_missing_as_null` is required to make sure that "empty" values (e.g., `None` and `()`)
// are serialized as `null` and not `undefined`.
// This is due to certain drivers (e.g., LibSQL) not supporting `undefined` values.
// - `serialize_large_number_types_as_bigints` is required to allow reading bigints from Prisma Client.
static DEFAULT_SERIALIZER: Serializer = Serializer::new()
.serialize_large_number_types_as_bigints(true)
.serialize_missing_as_null(true);

pub(crate) trait ToJsValue: Sized {
fn to_js_value(&self) -> Result<JsValue, JsValue>;
Expand Down
6 changes: 3 additions & 3 deletions query-engine/query-engine-wasm/analyse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"crates": "node --import tsx --no-warnings ./src/crates.ts"
},
"devDependencies": {
"ts-node": "^10.9.2",
"tsx": "^4.7.0",
"typescript": "^5.3.3"
"ts-node": "10.9.2",
"tsx": "4.7.0",
"typescript": "5.3.3"
}
}
6 changes: 3 additions & 3 deletions query-engine/query-engine-wasm/analyse/pnpm-lock.yaml

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

0 comments on commit f171d68

Please sign in to comment.