@lark-apaas/db-schema-sync 0.1.11-alpha.2 → 0.1.11-beta.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-MY6YRWYZ.js";
9
+ } from "./chunk-GMOS2KWD.js";
10
10
 
11
11
  // node_modules/dotenv/package.json
12
12
  var require_package = __commonJS({
@@ -1644,6 +1644,12 @@ function formatDefaultValue(value, field) {
1644
1644
  }
1645
1645
  return `.default(${trimmed})`;
1646
1646
  }
1647
+ if (field && STRING_NUMERIC_TYPES.has(field.type)) {
1648
+ const castMatch = trimmed.match(/^'?(-?\d+(?:\.\d+)?)'?::(?:numeric|decimal)(?:\(\d+(?:,\s*\d+)?\))?$/i);
1649
+ if (castMatch) {
1650
+ return `.default('${castMatch[1]}')`;
1651
+ }
1652
+ }
1647
1653
  if (field && CUSTOM_CAST_TYPES.has(field.type) && !trimmed.includes("::") && trimmed.toLowerCase() !== CURRENT_USER_SENTINEL) {
1648
1654
  const pgLiteral = trimmed.replace(/'/g, "''");
1649
1655
  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-MY6YRWYZ.js";
8
+ } from "./chunk-GMOS2KWD.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-alpha.2",
3
+ "version": "0.1.11-beta.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",