@lark-apaas/db-schema-sync 0.1.11 → 0.1.12-alpha.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/bin.js
CHANGED
|
@@ -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