@palbase/backend 30.0.1 → 33.0.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/palbase-backend.cjs +210 -24
- package/dist/bin/palbase-backend.cjs.map +1 -1
- package/dist/bin/palbase-backend.js +7 -7
- package/dist/{chunk-TWX6JTGJ.js → chunk-26GH54D2.js} +3 -5
- package/dist/{chunk-TWX6JTGJ.js.map → chunk-26GH54D2.js.map} +1 -1
- package/dist/{chunk-VVMJEVQP.js → chunk-BRLJOXWS.js} +2 -2
- package/dist/{chunk-3TUJWHC2.js → chunk-C4ZA5AT2.js} +378 -19
- package/dist/chunk-C4ZA5AT2.js.map +1 -0
- package/dist/{chunk-RADVOY7Y.js → chunk-DCDHAKF3.js} +147 -33
- package/dist/chunk-DCDHAKF3.js.map +1 -0
- package/dist/{chunk-ENZ2RFFJ.js → chunk-GOPZPM2A.js} +3 -310
- package/dist/chunk-GOPZPM2A.js.map +1 -0
- package/dist/{chunk-CGNN2PUH.js → chunk-KATPXCJ5.js} +37 -4
- package/dist/{chunk-CGNN2PUH.js.map → chunk-KATPXCJ5.js.map} +1 -1
- package/dist/{chunk-YRVIWHJC.js → chunk-N54QZER3.js} +23 -323
- package/dist/chunk-N54QZER3.js.map +1 -0
- package/dist/chunk-QMFOL2K6.js +371 -0
- package/dist/chunk-QMFOL2K6.js.map +1 -0
- package/dist/chunk-XOX6RFPZ.js +383 -0
- package/dist/chunk-XOX6RFPZ.js.map +1 -0
- package/dist/db/index.cjs +41 -2
- package/dist/db/index.cjs.map +1 -1
- package/dist/db/index.d.cts +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.js +12 -13
- package/dist/engine/index.cjs +210 -24
- package/dist/engine/index.cjs.map +1 -1
- package/dist/engine/index.d.cts +3 -3
- package/dist/engine/index.d.ts +3 -3
- package/dist/engine/index.js +7 -7
- package/dist/{index-DtCgaZAg.d.cts → index-BWgnGj68.d.cts} +185 -35
- package/dist/{index-b-Q3l7W5.d.ts → index-Bi74dcOu.d.ts} +9 -2
- package/dist/{index-8qy3kIuA.d.ts → index-Dg10RnZO.d.ts} +185 -35
- package/dist/{index-Zi7MptvP.d.cts → index-g6iQyYci.d.cts} +9 -2
- package/dist/index.cjs +135 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -23
- package/dist/index.d.ts +6 -23
- package/dist/index.js +48 -48
- package/dist/index.js.map +1 -1
- package/dist/openapi/index.d.cts +2 -2
- package/dist/openapi/index.d.ts +2 -2
- package/dist/openapi/index.js +3 -4
- package/dist/openapi/index.js.map +1 -1
- package/dist/{registry-CEYLH-Iz.d.cts → registry-6VT5RPeO.d.cts} +1 -1
- package/dist/{registry-BGJ-Al6F.d.ts → registry-B-sxJJN0.d.ts} +1 -1
- package/dist/test/index.cjs +733 -17
- package/dist/test/index.cjs.map +1 -1
- package/dist/test/index.d.cts +59 -4
- package/dist/test/index.d.ts +59 -4
- package/dist/test/index.js +56 -16
- package/dist/test/index.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/auth.md +102 -20
- package/docs/database.md +54 -0
- package/docs/llms-full.txt +215 -21
- package/docs/schema.md +58 -0
- package/package.json +1 -1
- package/template/db/public.ts +23 -0
- package/template/package.json +1 -1
- package/dist/chunk-3TUJWHC2.js.map +0 -1
- package/dist/chunk-ENZ2RFFJ.js.map +0 -1
- package/dist/chunk-RADVOY7Y.js.map +0 -1
- package/dist/chunk-SG4UTNOP.js +0 -374
- package/dist/chunk-SG4UTNOP.js.map +0 -1
- package/dist/chunk-VXPNPVAG.js +0 -40
- package/dist/chunk-VXPNPVAG.js.map +0 -1
- package/dist/chunk-YRVIWHJC.js.map +0 -1
- /package/dist/{chunk-VVMJEVQP.js.map → chunk-BRLJOXWS.js.map} +0 -0
package/dist/db/index.cjs
CHANGED
|
@@ -777,9 +777,48 @@ var ColumnBuilder = class _ColumnBuilder {
|
|
|
777
777
|
* A transform is a PROJECTION, never a constraint: it lives only in this
|
|
778
778
|
* process, so it can neither validate nor migrate what is stored.
|
|
779
779
|
*/
|
|
780
|
+
/**
|
|
781
|
+
* Surface this exact-precision column as a JS `number` (FR-001).
|
|
782
|
+
*
|
|
783
|
+
* `numeric`/`bigint` arrive as strings because a JS number cannot hold their
|
|
784
|
+
* full range — correct, and exactly why this exists: application code that
|
|
785
|
+
* does arithmetic on the column otherwise rewrites the same `Number(row.x)` /
|
|
786
|
+
* `String(v)` pair in every caller, and each rewrite is a place the two
|
|
787
|
+
* directions can drift apart.
|
|
788
|
+
*/
|
|
789
|
+
asNumber() {
|
|
790
|
+
return this.withCodec("number", "asNumber");
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Surface this exact-precision column as a `string` — the value Postgres
|
|
794
|
+
* sent, DECLARED rather than defaulted (FR-001).
|
|
795
|
+
*/
|
|
796
|
+
asDecimal() {
|
|
797
|
+
return this.withCodec("decimal", "asDecimal");
|
|
798
|
+
}
|
|
799
|
+
withCodec(codec, method) {
|
|
800
|
+
if (this._def.type !== "bigint" && this._def.type !== "numeric") {
|
|
801
|
+
throw new Error(`${this._def.type} column: .${method}() is only available on bigint()/numeric() \u2014 those are the exact-precision types that surface as string.`);
|
|
802
|
+
}
|
|
803
|
+
if (this._def.transform !== void 0) {
|
|
804
|
+
throw new Error(`.${method}() and .transform() are two ways to say the same thing on one column \u2014 keep .${method}().`);
|
|
805
|
+
}
|
|
806
|
+
if (this._def.codec !== void 0) {
|
|
807
|
+
throw new Error(`column already declares .as${this._def.codec === "number" ? "Number" : "Decimal"}(); a column has ONE codec.`);
|
|
808
|
+
}
|
|
809
|
+
return new _ColumnBuilder(this._def.type, {
|
|
810
|
+
...this._def,
|
|
811
|
+
codec
|
|
812
|
+
});
|
|
813
|
+
}
|
|
780
814
|
transform(fns) {
|
|
781
|
-
this._def.
|
|
782
|
-
|
|
815
|
+
if (this._def.codec !== void 0) {
|
|
816
|
+
throw new Error(`column already declares a named codec; .transform() and .as*() are two ways to say the same thing \u2014 keep the codec.`);
|
|
817
|
+
}
|
|
818
|
+
return new _ColumnBuilder(this._def.type, {
|
|
819
|
+
...this._def,
|
|
820
|
+
transform: fns
|
|
821
|
+
});
|
|
783
822
|
}
|
|
784
823
|
};
|
|
785
824
|
function uuid() {
|