@vibeorm/schema 5.3.0 → 5.5.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.
@@ -151,6 +151,15 @@ export type DialectCapabilities = {
151
151
  * built.
152
152
  */
153
153
  readonly dateTruncation: boolean;
154
+ /**
155
+ * Row capture (`$transaction(…, { capture })`): a data-modifying statement
156
+ * reports the declared columns of the rows it changed as they were before
157
+ * and after it, as text — `RETURNING old."col"::text, new."col"::text`,
158
+ * PostgreSQL 18 or later (the server version is checked when a captured
159
+ * transaction opens). Without it `capture` is refused before the
160
+ * transaction opens.
161
+ */
162
+ readonly rowCapture: boolean;
154
163
  };
155
164
  export declare const POSTGRES_CAPABILITIES: DialectCapabilities;
156
165
  export declare const SQLITE_CAPABILITIES: DialectCapabilities;
package/dist/errors.d.ts CHANGED
@@ -163,7 +163,7 @@ export declare const SCOPED_REFUSAL_REASONS: readonly [
163
163
  "unknown_column",
164
164
  /** A { column } entry names a field that cannot carry a scope (list/enum/non-scalar type). */
165
165
  "column_not_scopeable",
166
- /** A { through } entry names an unknown or to-many relation. */
166
+ /** A { through } entry names an unknown or to-many relation, or the side of a to-one relation without the foreign key. */
167
167
  "unknown_relation",
168
168
  /** A { through } chain cycles or ends on a "none" model instead of a { column } one. */
169
169
  "through_chain_invalid",
@@ -186,7 +186,15 @@ export declare const SCOPED_REFUSAL_REASONS: readonly [
186
186
  /** orderBy through a relation onto a scoped model would leak cross-tenant ordering. */
187
187
  "relation_orderby_on_scoped",
188
188
  /** An unfiltered relation _count of a scoped model would count foreign rows. */
189
- "count_on_scoped_relation"];
189
+ "count_on_scoped_relation",
190
+ /** An upsertMany conflict target could match another tenant's row (it omits the tenant column, or hides its columns). */
191
+ "conflict_target_unscoped",
192
+ /** The call reaches a model a bound scope maps to "deny" — as its own call, a relation filter, a selection, a count, an order or a nested write. */
193
+ "model_denied",
194
+ /** A create leaves out a column a list scope restricts — the handle never picks a value from the list. */
195
+ "scope_value_required",
196
+ /** `$scoped({ scopes: {} })` — the named form binds at least one scope. */
197
+ "no_scope_bound"];
190
198
  export type ScopedRefusalReason = (typeof SCOPED_REFUSAL_REASONS)[number];
191
199
  /**
192
200
  * A refusal from a tenant-scoped handle (`$scoped`). Carries the model, the
package/dist/index.js CHANGED
@@ -105,7 +105,11 @@ var SCOPED_REFUSAL_REASONS = [
105
105
  "through_fk_write",
106
106
  "nested_refused",
107
107
  "relation_orderby_on_scoped",
108
- "count_on_scoped_relation"
108
+ "count_on_scoped_relation",
109
+ "conflict_target_unscoped",
110
+ "model_denied",
111
+ "scope_value_required",
112
+ "no_scope_bound"
109
113
  ];
110
114
 
111
115
  class ScopedQueryError extends VibeError {
@@ -467,7 +471,8 @@ var POSTGRES_CAPABILITIES = Object.freeze({
467
471
  timeOfDayTypes: Object.freeze(["time", "timetz"]),
468
472
  uuidColumns: "native",
469
473
  localDateColumns: true,
470
- dateTruncation: true
474
+ dateTruncation: true,
475
+ rowCapture: true
471
476
  });
472
477
  var SQLITE_CAPABILITIES = Object.freeze({
473
478
  rowRuleAppendOnly: true,
@@ -508,7 +513,8 @@ var SQLITE_CAPABILITIES = Object.freeze({
508
513
  timeOfDayTypes: Object.freeze([]),
509
514
  uuidColumns: "text",
510
515
  localDateColumns: true,
511
- dateTruncation: false
516
+ dateTruncation: false,
517
+ rowCapture: false
512
518
  });
513
519
  var MYSQL_CAPABILITIES = Object.freeze({
514
520
  rowRuleAppendOnly: true,
@@ -549,7 +555,8 @@ var MYSQL_CAPABILITIES = Object.freeze({
549
555
  timeOfDayTypes: Object.freeze(["time"]),
550
556
  uuidColumns: "unsupported",
551
557
  localDateColumns: true,
552
- dateTruncation: false
558
+ dateTruncation: false,
559
+ rowCapture: false
553
560
  });
554
561
  var DIALECT_CAPABILITIES = Object.freeze({
555
562
  postgres: POSTGRES_CAPABILITIES,
@@ -2837,6 +2844,7 @@ var RESERVED_ENUM_NAMES = [
2837
2844
  "ScopedClientInstance",
2838
2845
  "ScopedModelsConfig",
2839
2846
  "ScopedNestedMode",
2847
+ "ScopedScopeConfig",
2840
2848
  "VibeTransactionClientInstance",
2841
2849
  "ScopedTransactionClientInstance",
2842
2850
  "ReadOnlyClientInstance",
@@ -4562,4 +4570,4 @@ export {
4562
4570
  validatorRefIssue
4563
4571
  };
4564
4572
 
4565
- //# debugId=B8429E15DEC34CA164756E2164756E21
4573
+ //# debugId=143878A615D384D864756E2164756E21