@atscript/db-mysql 0.1.176 → 0.1.177

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.cjs CHANGED
@@ -3160,7 +3160,10 @@ function sanitizeParams(params) {
3160
3160
  * `jsonStrings`, so another pool's parser could otherwise be reused.
3161
3161
  */
3162
3162
  function atscriptTypeCast(field, next) {
3163
- if (field.type === "JSON") return field.string("utf8");
3163
+ if (field.type === "JSON") {
3164
+ const bytes = field.buffer();
3165
+ return bytes === null ? null : bytes.toString("utf8");
3166
+ }
3164
3167
  if (field.type === "TIMESTAMP" || field.type === "DATETIME") {
3165
3168
  const str = field.string();
3166
3169
  if (str === null) return null;
package/dist/index.mjs CHANGED
@@ -3159,7 +3159,10 @@ function sanitizeParams(params) {
3159
3159
  * `jsonStrings`, so another pool's parser could otherwise be reused.
3160
3160
  */
3161
3161
  function atscriptTypeCast(field, next) {
3162
- if (field.type === "JSON") return field.string("utf8");
3162
+ if (field.type === "JSON") {
3163
+ const bytes = field.buffer();
3164
+ return bytes === null ? null : bytes.toString("utf8");
3165
+ }
3163
3166
  if (field.type === "TIMESTAMP" || field.type === "DATETIME") {
3164
3167
  const str = field.string();
3165
3168
  if (str === null) return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atscript/db-mysql",
3
- "version": "0.1.176",
3
+ "version": "0.1.177",
4
4
  "description": "MySQL adapter for @atscript/db with mysql2 driver support.",
5
5
  "keywords": [
6
6
  "atscript",
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@atscript/db-sql-tools": "^0.1.176"
44
+ "@atscript/db-sql-tools": "^0.1.177"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@atscript/core": "^0.2.12",
@@ -55,7 +55,7 @@
55
55
  "@atscript/typescript": "^0.2.12",
56
56
  "@uniqu/core": "^0.2.2",
57
57
  "mysql2": ">=3.0.0",
58
- "@atscript/db": "^0.1.176"
58
+ "@atscript/db": "^0.1.177"
59
59
  },
60
60
  "peerDependenciesMeta": {
61
61
  "mysql2": {