@vibeorm/schema 5.4.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",
@@ -188,7 +188,13 @@ export declare const SCOPED_REFUSAL_REASONS: readonly [
188
188
  /** An unfiltered relation _count of a scoped model would count foreign rows. */
189
189
  "count_on_scoped_relation",
190
190
  /** An upsertMany conflict target could match another tenant's row (it omits the tenant column, or hides its columns). */
191
- "conflict_target_unscoped"];
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"];
192
198
  export type ScopedRefusalReason = (typeof SCOPED_REFUSAL_REASONS)[number];
193
199
  /**
194
200
  * A refusal from a tenant-scoped handle (`$scoped`). Carries the model, the
package/dist/index.js CHANGED
@@ -106,7 +106,10 @@ var SCOPED_REFUSAL_REASONS = [
106
106
  "nested_refused",
107
107
  "relation_orderby_on_scoped",
108
108
  "count_on_scoped_relation",
109
- "conflict_target_unscoped"
109
+ "conflict_target_unscoped",
110
+ "model_denied",
111
+ "scope_value_required",
112
+ "no_scope_bound"
110
113
  ];
111
114
 
112
115
  class ScopedQueryError extends VibeError {
@@ -468,7 +471,8 @@ var POSTGRES_CAPABILITIES = Object.freeze({
468
471
  timeOfDayTypes: Object.freeze(["time", "timetz"]),
469
472
  uuidColumns: "native",
470
473
  localDateColumns: true,
471
- dateTruncation: true
474
+ dateTruncation: true,
475
+ rowCapture: true
472
476
  });
473
477
  var SQLITE_CAPABILITIES = Object.freeze({
474
478
  rowRuleAppendOnly: true,
@@ -509,7 +513,8 @@ var SQLITE_CAPABILITIES = Object.freeze({
509
513
  timeOfDayTypes: Object.freeze([]),
510
514
  uuidColumns: "text",
511
515
  localDateColumns: true,
512
- dateTruncation: false
516
+ dateTruncation: false,
517
+ rowCapture: false
513
518
  });
514
519
  var MYSQL_CAPABILITIES = Object.freeze({
515
520
  rowRuleAppendOnly: true,
@@ -550,7 +555,8 @@ var MYSQL_CAPABILITIES = Object.freeze({
550
555
  timeOfDayTypes: Object.freeze(["time"]),
551
556
  uuidColumns: "unsupported",
552
557
  localDateColumns: true,
553
- dateTruncation: false
558
+ dateTruncation: false,
559
+ rowCapture: false
554
560
  });
555
561
  var DIALECT_CAPABILITIES = Object.freeze({
556
562
  postgres: POSTGRES_CAPABILITIES,
@@ -2838,6 +2844,7 @@ var RESERVED_ENUM_NAMES = [
2838
2844
  "ScopedClientInstance",
2839
2845
  "ScopedModelsConfig",
2840
2846
  "ScopedNestedMode",
2847
+ "ScopedScopeConfig",
2841
2848
  "VibeTransactionClientInstance",
2842
2849
  "ScopedTransactionClientInstance",
2843
2850
  "ReadOnlyClientInstance",
@@ -4563,4 +4570,4 @@ export {
4563
4570
  validatorRefIssue
4564
4571
  };
4565
4572
 
4566
- //# debugId=DBFAE1DBBF57344464756E2164756E21
4573
+ //# debugId=143878A615D384D864756E2164756E21