@drzl/analyzer 1.8.0 → 1.9.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/index.cjs +3 -0
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +3 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -122,6 +122,9 @@ function describeV1Column(column) {
|
|
|
122
122
|
case "numeric":
|
|
123
123
|
out.tsType = "string";
|
|
124
124
|
out.dbType = "NUMERIC";
|
|
125
|
+
if (!String(column?.constructor?.[/* @__PURE__ */ Symbol.for("drizzle:entityKind")] ?? "").startsWith("SQLite")) {
|
|
126
|
+
out.format = "numeric";
|
|
127
|
+
}
|
|
125
128
|
break;
|
|
126
129
|
case "json":
|
|
127
130
|
out.tsType = "any";
|
package/dist/index.d.cts
CHANGED
|
@@ -62,8 +62,16 @@ interface Column {
|
|
|
62
62
|
* generators fall back to the old inference there.
|
|
63
63
|
*/
|
|
64
64
|
integer?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
|
|
65
|
+
/**
|
|
66
|
+
* A string column whose contents have a shape the database enforces.
|
|
67
|
+
*
|
|
68
|
+
* Only formats checked against Postgres itself appear here, and the list is short because most
|
|
69
|
+
* candidates failed: Postgres reads `'today'` and `'January 8, 1999'` as dates, pads
|
|
70
|
+
* `'2020-01-01'` into a macaddr, and accepts `'10.1/16'` as an inet. A check for any of those
|
|
71
|
+
* would reject input the database accepts, and turning away valid data is worse than not
|
|
72
|
+
* checking at all. See `COLUMN_FORMATS` in `@drzl/validation-core`.
|
|
73
|
+
*/
|
|
74
|
+
format?: 'uuid' | 'numeric';
|
|
67
75
|
/**
|
|
68
76
|
* Array depth for a column declared with `.array()`, absent when the column is a scalar.
|
|
69
77
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -62,8 +62,16 @@ interface Column {
|
|
|
62
62
|
* generators fall back to the old inference there.
|
|
63
63
|
*/
|
|
64
64
|
integer?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
|
|
65
|
+
/**
|
|
66
|
+
* A string column whose contents have a shape the database enforces.
|
|
67
|
+
*
|
|
68
|
+
* Only formats checked against Postgres itself appear here, and the list is short because most
|
|
69
|
+
* candidates failed: Postgres reads `'today'` and `'January 8, 1999'` as dates, pads
|
|
70
|
+
* `'2020-01-01'` into a macaddr, and accepts `'10.1/16'` as an inet. A check for any of those
|
|
71
|
+
* would reject input the database accepts, and turning away valid data is worse than not
|
|
72
|
+
* checking at all. See `COLUMN_FORMATS` in `@drzl/validation-core`.
|
|
73
|
+
*/
|
|
74
|
+
format?: 'uuid' | 'numeric';
|
|
67
75
|
/**
|
|
68
76
|
* Array depth for a column declared with `.array()`, absent when the column is a scalar.
|
|
69
77
|
*
|
package/dist/index.js
CHANGED
|
@@ -85,6 +85,9 @@ function describeV1Column(column) {
|
|
|
85
85
|
case "numeric":
|
|
86
86
|
out.tsType = "string";
|
|
87
87
|
out.dbType = "NUMERIC";
|
|
88
|
+
if (!String(column?.constructor?.[/* @__PURE__ */ Symbol.for("drizzle:entityKind")] ?? "").startsWith("SQLite")) {
|
|
89
|
+
out.format = "numeric";
|
|
90
|
+
}
|
|
88
91
|
break;
|
|
89
92
|
case "json":
|
|
90
93
|
out.tsType = "any";
|