@vibeorm/schema 5.6.0 → 5.8.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/ir.d.ts CHANGED
@@ -131,6 +131,16 @@ export type FieldIR = {
131
131
  * Absent = server/table default (LOWER() kept — conservative).
132
132
  */
133
133
  readonly collation?: string;
134
+ /**
135
+ * How a `BigInt` column reads in JavaScript (`@number`, `dsl.bigint({ mode: "number" })`).
136
+ * `"number"`: a safe `number` instead of a `bigint`, typed `number` in the
137
+ * generated client; a stored value beyond `Number.MAX_SAFE_INTEGER` (or below
138
+ * its negative) fails the read with `VIBE_DATA_INVALID`, and a write of an
139
+ * unsafe number refuses with `VIBE_VALIDATION`, never rounding. Aggregates
140
+ * that carry the field's type (`_sum`, `_min`, `_max`) follow it. Absent =
141
+ * `bigint`. No DDL: the column stays 8-byte.
142
+ */
143
+ readonly bigIntMode?: "number";
134
144
  };
135
145
  export type RelationType = "oneToOne" | "oneToMany" | "manyToOne" | "manyToMany";
136
146
  export type CascadeAction = "Cascade" | "Restrict" | "NoAction" | "SetNull" | "SetDefault";
@@ -32,4 +32,15 @@ export declare function resolveReferentialActions(params: {
32
32
  readonly onDelete: CascadeAction;
33
33
  readonly onUpdate: CascadeAction;
34
34
  };
35
+ /**
36
+ * The first to-one relation whose foreign key includes `field` and declares
37
+ * SET DEFAULT on delete or update: the database would then write that
38
+ * column's default, which for a tenant column can be another tenant's value.
39
+ * SET DEFAULT is never an implied action, so the declared one is the
40
+ * effective one.
41
+ */
42
+ export declare function setDefaultRelationOf<Relation extends Pick<RelationIR, "fields" | "onDelete" | "onUpdate" | "isList">>(params: {
43
+ relations: readonly Relation[];
44
+ field: string;
45
+ }): Relation | undefined;
35
46
  //# sourceMappingURL=referential-actions.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibeorm/schema",
3
- "version": "5.6.0",
3
+ "version": "5.8.0",
4
4
  "description": "Canonical schema IR, validation, dialect/capability types, and error codes for VibeORM v2",
5
5
  "keywords": [
6
6
  "orm",