@inflector/optima 1.1.5 → 1.1.7
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.
|
@@ -117,9 +117,8 @@ var Json = (obj) => {
|
|
|
117
117
|
return col.STRUCTType(duckDBStructString);
|
|
118
118
|
};
|
|
119
119
|
var Array = (schema) => {
|
|
120
|
-
const innerType = zodToDuckDBType(schema);
|
|
121
120
|
const col = Column().SQlType("LIST");
|
|
122
|
-
return col.STRUCTType(
|
|
121
|
+
return col.STRUCTType(`VARCHAR`);
|
|
123
122
|
};
|
|
124
123
|
var Email = () => Column().SQlType("VARCHAR").validate((v) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v));
|
|
125
124
|
var Slug = () => Column().SQlType("VARCHAR").validate((v) => /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(v));
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
Timestamp,
|
|
20
20
|
Uuid,
|
|
21
21
|
refHelpers
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-FJ2AFIGL.js";
|
|
23
23
|
|
|
24
24
|
// src/database.ts
|
|
25
25
|
import { DuckDBInstance } from "@duckdb/node-api";
|
|
@@ -296,7 +296,7 @@ var escape = (val) => {
|
|
|
296
296
|
if (val === null || val === void 0) return "NULL";
|
|
297
297
|
if (typeof val === "bigint") return val.toString();
|
|
298
298
|
if (typeof val === "string") {
|
|
299
|
-
return `'${val.replace(
|
|
299
|
+
return `'${val.replace(/'/g, "''")}'`;
|
|
300
300
|
}
|
|
301
301
|
if (val instanceof Date) return `'${val.toISOString()}'`;
|
|
302
302
|
if (typeof val === "boolean") return val ? "TRUE" : "FALSE";
|
|
@@ -305,7 +305,7 @@ var escape = (val) => {
|
|
|
305
305
|
val,
|
|
306
306
|
(_, v) => typeof v === "bigint" ? v.toString() : v
|
|
307
307
|
);
|
|
308
|
-
return `'${safe.replace(
|
|
308
|
+
return `'${safe.replace(/'/g, "''")}'`;
|
|
309
309
|
}
|
|
310
310
|
return String(val);
|
|
311
311
|
};
|
|
@@ -488,7 +488,7 @@ ${valuesBlock}${isReturning ? "\nRETURNING *" : ""};`;
|
|
|
488
488
|
if (type?.SQlType === "STRUCT" && type?.STRUCTType === "STRUCT()") {
|
|
489
489
|
return JSON.parse(value);
|
|
490
490
|
}
|
|
491
|
-
if (type?.SQlType === "LIST" && type?.STRUCTType === "VARCHAR
|
|
491
|
+
if (type?.SQlType === "LIST" && type?.STRUCTType === "VARCHAR") {
|
|
492
492
|
return JSON.parse(value);
|
|
493
493
|
}
|
|
494
494
|
return value;
|
package/dist/types.js
CHANGED