@prisma/adapter-mssql 7.10.1 → 7.11.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -407,6 +407,9 @@ function mapIsolationLevel(level) {
407
407
  });
408
408
  }
409
409
  }
410
+ function isFloatArg(arg, argType) {
411
+ return typeof arg === "number" && (argType.dbType === "FLOAT" || argType.dbType === "REAL");
412
+ }
410
413
  function mapArg(arg, argType) {
411
414
  if (arg === null) {
412
415
  return null;
@@ -704,10 +707,13 @@ var MssqlQueryable = class {
704
707
  req.arrayRowMode = true;
705
708
  for (let i = 0; i < query.args.length; i++) {
706
709
  const argType = query.argTypes[i];
707
- if (query.args[i] === null && argType.scalarType === "bytes") {
710
+ const arg = query.args[i];
711
+ if (arg === null && argType.scalarType === "bytes") {
708
712
  req.input(`P${i + 1}`, import_mssql3.default.VarBinary, null);
713
+ } else if (isFloatArg(arg, argType)) {
714
+ req.input(`P${i + 1}`, import_mssql3.default.Float, arg);
709
715
  } else {
710
- req.input(`P${i + 1}`, mapArg(query.args[i], argType));
716
+ req.input(`P${i + 1}`, mapArg(arg, argType));
711
717
  }
712
718
  }
713
719
  const res = await req.query(query.sql);
package/dist/index.mjs CHANGED
@@ -377,6 +377,9 @@ function mapIsolationLevel(level) {
377
377
  });
378
378
  }
379
379
  }
380
+ function isFloatArg(arg, argType) {
381
+ return typeof arg === "number" && (argType.dbType === "FLOAT" || argType.dbType === "REAL");
382
+ }
380
383
  function mapArg(arg, argType) {
381
384
  if (arg === null) {
382
385
  return null;
@@ -674,10 +677,13 @@ var MssqlQueryable = class {
674
677
  req.arrayRowMode = true;
675
678
  for (let i = 0; i < query.args.length; i++) {
676
679
  const argType = query.argTypes[i];
677
- if (query.args[i] === null && argType.scalarType === "bytes") {
680
+ const arg = query.args[i];
681
+ if (arg === null && argType.scalarType === "bytes") {
678
682
  req.input(`P${i + 1}`, sql3.VarBinary, null);
683
+ } else if (isFloatArg(arg, argType)) {
684
+ req.input(`P${i + 1}`, sql3.Float, arg);
679
685
  } else {
680
- req.input(`P${i + 1}`, mapArg(query.args[i], argType));
686
+ req.input(`P${i + 1}`, mapArg(arg, argType));
681
687
  }
682
688
  }
683
689
  const res = await req.query(query.sql);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/adapter-mssql",
3
- "version": "7.10.1",
3
+ "version": "7.11.0-dev.1",
4
4
  "description": "Prisma's driver adapter for \"mssql\"",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,14 +33,13 @@
33
33
  "dependencies": {
34
34
  "mssql": "^12.2.0",
35
35
  "async-mutex": "0.5.0",
36
- "@prisma/driver-adapter-utils": "7.10.1"
36
+ "@prisma/driver-adapter-utils": "7.11.0-dev.1"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/mssql": "9.1.8"
40
40
  },
41
41
  "scripts": {
42
42
  "dev": "DEV=true tsx helpers/build.ts",
43
- "build": "tsx helpers/build.ts",
44
- "test": "vitest run"
43
+ "build": "tsx helpers/build.ts"
45
44
  }
46
45
  }