@vibeorm/schema 5.2.0 → 5.4.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/capabilities.d.ts +2 -0
- package/dist/errors.d.ts +5 -1
- package/dist/extension.d.ts +2 -0
- package/dist/index.js +16 -2
- package/dist/index.js.map +7 -7
- package/package.json +1 -1
package/dist/capabilities.d.ts
CHANGED
|
@@ -76,6 +76,8 @@ export type DialectCapabilities = {
|
|
|
76
76
|
readonly nativeRowLevelSecurity: boolean;
|
|
77
77
|
/** INSERT/UPDATE/DELETE ... RETURNING. False ⇒ insertId + re-select fallback. */
|
|
78
78
|
readonly returning: boolean;
|
|
79
|
+
/** Count-only writes can assert their exact direct row count inside the same SQL statement. */
|
|
80
|
+
readonly exactRowCount: boolean;
|
|
79
81
|
/** Native scalar array columns (String[], Int[], ...). */
|
|
80
82
|
readonly scalarArrays: boolean;
|
|
81
83
|
/** Native enum column types (CREATE TYPE / inline ENUM). */
|
package/dist/errors.d.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export declare const VIBE_ERROR_CODES: readonly [
|
|
10
10
|
/** findUniqueOrThrow / findFirstOrThrow / update / delete target missing. */
|
|
11
11
|
"VIBE_NOT_FOUND",
|
|
12
|
+
/** A count-only write's exact affected-row expectation did not match. */
|
|
13
|
+
"VIBE_ROW_COUNT_MISMATCH",
|
|
12
14
|
/** Unique constraint violation (driver-mapped). */
|
|
13
15
|
"VIBE_UNIQUE_VIOLATION",
|
|
14
16
|
/** Exclusion constraint violation (PostgreSQL SQLSTATE 23P01). */
|
|
@@ -184,7 +186,9 @@ export declare const SCOPED_REFUSAL_REASONS: readonly [
|
|
|
184
186
|
/** orderBy through a relation onto a scoped model would leak cross-tenant ordering. */
|
|
185
187
|
"relation_orderby_on_scoped",
|
|
186
188
|
/** An unfiltered relation _count of a scoped model would count foreign rows. */
|
|
187
|
-
"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"];
|
|
188
192
|
export type ScopedRefusalReason = (typeof SCOPED_REFUSAL_REASONS)[number];
|
|
189
193
|
/**
|
|
190
194
|
* A refusal from a tenant-scoped handle (`$scoped`). Carries the model, the
|
package/dist/extension.d.ts
CHANGED
|
@@ -185,6 +185,8 @@ export type ExtensionClientContribution = {
|
|
|
185
185
|
* type or at runtime.
|
|
186
186
|
*/
|
|
187
187
|
readonly readOnly?: true | readonly string[];
|
|
188
|
+
/** Opt this surface into explicit lazy operation capture and transaction batching. */
|
|
189
|
+
readonly lazy?: true;
|
|
188
190
|
readonly runtimeGlue: string;
|
|
189
191
|
readonly dts: readonly string[];
|
|
190
192
|
readonly dtsTypes?: readonly string[];
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// packages/schema/src/errors.ts
|
|
3
3
|
var VIBE_ERROR_CODES = [
|
|
4
4
|
"VIBE_NOT_FOUND",
|
|
5
|
+
"VIBE_ROW_COUNT_MISMATCH",
|
|
5
6
|
"VIBE_UNIQUE_VIOLATION",
|
|
6
7
|
"VIBE_EXCLUSION_VIOLATION",
|
|
7
8
|
"VIBE_FK_VIOLATION",
|
|
@@ -104,7 +105,8 @@ var SCOPED_REFUSAL_REASONS = [
|
|
|
104
105
|
"through_fk_write",
|
|
105
106
|
"nested_refused",
|
|
106
107
|
"relation_orderby_on_scoped",
|
|
107
|
-
"count_on_scoped_relation"
|
|
108
|
+
"count_on_scoped_relation",
|
|
109
|
+
"conflict_target_unscoped"
|
|
108
110
|
];
|
|
109
111
|
|
|
110
112
|
class ScopedQueryError extends VibeError {
|
|
@@ -228,6 +230,10 @@ var RESERVED_CLIENT_NAMES = [
|
|
|
228
230
|
"$querySqlResult",
|
|
229
231
|
"$executeSql",
|
|
230
232
|
"$queryRaw",
|
|
233
|
+
"$queueRaw",
|
|
234
|
+
"$lazy",
|
|
235
|
+
"$queryRawLazy",
|
|
236
|
+
"$executeRawLazy",
|
|
231
237
|
"$queryRawUnsafe",
|
|
232
238
|
"$executeRaw",
|
|
233
239
|
"$executeRawUnsafe",
|
|
@@ -242,6 +248,7 @@ var RESERVED_CLIENT_NAMES = [
|
|
|
242
248
|
"$models",
|
|
243
249
|
"$withContext",
|
|
244
250
|
"$advisoryLock",
|
|
251
|
+
"$advisoryLocks",
|
|
245
252
|
"$tryAdvisoryLock"
|
|
246
253
|
];
|
|
247
254
|
var RESERVED_COLUMN_PREFIX = "__vibe_";
|
|
@@ -441,6 +448,7 @@ var POSTGRES_CAPABILITIES = Object.freeze({
|
|
|
441
448
|
predicateArithmeticTypes: Object.freeze(["Int", "BigInt", "Float", "Decimal"]),
|
|
442
449
|
nativeRowLevelSecurity: true,
|
|
443
450
|
returning: true,
|
|
451
|
+
exactRowCount: true,
|
|
444
452
|
scalarArrays: true,
|
|
445
453
|
nativeEnums: true,
|
|
446
454
|
ilike: true,
|
|
@@ -481,6 +489,7 @@ var SQLITE_CAPABILITIES = Object.freeze({
|
|
|
481
489
|
predicateArithmeticTypes: Object.freeze(["Int", "BigInt", "Float"]),
|
|
482
490
|
nativeRowLevelSecurity: false,
|
|
483
491
|
returning: true,
|
|
492
|
+
exactRowCount: false,
|
|
484
493
|
scalarArrays: false,
|
|
485
494
|
nativeEnums: false,
|
|
486
495
|
ilike: false,
|
|
@@ -521,6 +530,7 @@ var MYSQL_CAPABILITIES = Object.freeze({
|
|
|
521
530
|
predicateArithmeticTypes: Object.freeze(["Int", "BigInt", "Float", "Decimal"]),
|
|
522
531
|
nativeRowLevelSecurity: false,
|
|
523
532
|
returning: false,
|
|
533
|
+
exactRowCount: false,
|
|
524
534
|
scalarArrays: false,
|
|
525
535
|
nativeEnums: true,
|
|
526
536
|
ilike: false,
|
|
@@ -2846,7 +2856,11 @@ var RESERVED_ENUM_NAMES = [
|
|
|
2846
2856
|
"TransactionOptions",
|
|
2847
2857
|
"CallbackTransactionOptions",
|
|
2848
2858
|
"RawStatement",
|
|
2859
|
+
"LazyRawExecuteOptions",
|
|
2860
|
+
"LazyRawQueryOptions",
|
|
2861
|
+
"QueueRawOptions",
|
|
2849
2862
|
"AdvisoryLockOptions",
|
|
2863
|
+
"AdvisoryLocksOptions",
|
|
2850
2864
|
"StatementDiagnosticsOptions",
|
|
2851
2865
|
"SchemaIR",
|
|
2852
2866
|
"VibeExtension",
|
|
@@ -4549,4 +4563,4 @@ export {
|
|
|
4549
4563
|
validatorRefIssue
|
|
4550
4564
|
};
|
|
4551
4565
|
|
|
4552
|
-
//# debugId=
|
|
4566
|
+
//# debugId=DBFAE1DBBF57344464756E2164756E21
|