@lark-apaas/db-schema-sync 0.1.11 → 0.1.12-alpha.0

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/bin.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  __toESM,
7
7
  generateSchema,
8
8
  resolveEnvOptions
9
- } from "./chunk-GMOS2KWD.js";
9
+ } from "./chunk-SLPV5WXI.js";
10
10
 
11
11
  // node_modules/dotenv/package.json
12
12
  var require_package = __commonJS({
@@ -1650,6 +1650,11 @@ function formatDefaultValue(value, field) {
1650
1650
  return `.default('${castMatch[1]}')`;
1651
1651
  }
1652
1652
  }
1653
+ if (field?.isArray && !CUSTOM_CAST_TYPES.has(field.type)) {
1654
+ if (/^(?:'?\{\}'?|ARRAY\[\])(?:::\w+\[\])?$/i.test(trimmed)) {
1655
+ return ".default([])";
1656
+ }
1657
+ }
1653
1658
  if (field && CUSTOM_CAST_TYPES.has(field.type) && !trimmed.includes("::") && trimmed.toLowerCase() !== CURRENT_USER_SENTINEL) {
1654
1659
  const pgLiteral = trimmed.replace(/'/g, "''");
1655
1660
  const escaped = pgLiteral.replace(/`/g, "\\`").replace(/\$\{/g, "\\${");
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  generateSchemaFromData,
6
6
  normalizeApiResponse,
7
7
  resolveEnvOptions
8
- } from "./chunk-GMOS2KWD.js";
8
+ } from "./chunk-SLPV5WXI.js";
9
9
  export {
10
10
  generateSchema,
11
11
  generateSchemaCode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/db-schema-sync",
3
- "version": "0.1.11",
3
+ "version": "0.1.12-alpha.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",