velocious 1.0.736 → 1.0.737
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/package.json
CHANGED
package/src/configuration.js
CHANGED
|
@@ -238,6 +238,20 @@ function normalizeHttpCompression(value) {
|
|
|
238
238
|
*/
|
|
239
239
|
const DEFAULT_MCP_MAX_REQUEST_BODY_BYTES = 1024 * 1024
|
|
240
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Lock names the framework must serve on its own database tier even when a
|
|
243
|
+
* lock server is enabled (design §5): they guard DB-internal work — schema
|
|
244
|
+
* apply and migrations — and a lock-server lock cannot serialize DDL against a
|
|
245
|
+
* direct database client that never speaks to the lock server. The whitelist
|
|
246
|
+
* excludes the lock server and the file tier; `process-local` stays eligible
|
|
247
|
+
* because a SQLite deployment has no database-native primitive to fall back to.
|
|
248
|
+
* @type {import("./database/advisory-lock-backend-policy.js").AdvisoryLockBackendPolicyEntry[]}
|
|
249
|
+
*/
|
|
250
|
+
const FRAMEWORK_DB_NATIVE_ADVISORY_LOCK_POLICY = [
|
|
251
|
+
{allowedTiers: ["driver-native", "process-local"], minTier: "process-local", name: "velocious-attachments-schema"},
|
|
252
|
+
{allowedTiers: ["driver-native", "process-local"], minTier: "process-local", name: "velocious:migrations:*"}
|
|
253
|
+
]
|
|
254
|
+
|
|
241
255
|
export default class VelociousConfiguration {
|
|
242
256
|
/**
|
|
243
257
|
* Close database connections promise.
|
|
@@ -4321,11 +4335,33 @@ export default class VelociousConfiguration {
|
|
|
4321
4335
|
}
|
|
4322
4336
|
|
|
4323
4337
|
/**
|
|
4324
|
-
* Runs get advisory lock policy
|
|
4338
|
+
* Runs get advisory lock policy: the consumer's declared entries, the
|
|
4339
|
+
* framework's DB-native names, and — once a lock server is enabled — a
|
|
4340
|
+
* catch-all that makes the lock-server tier the default authority for every
|
|
4341
|
+
* name the consumer did not declare (design §5/§9). Without a lock server the
|
|
4342
|
+
* configured policy is returned unchanged, so a deployment that configures
|
|
4343
|
+
* nothing keeps today's driver-native behavior for every name.
|
|
4325
4344
|
* @returns {import("./database/advisory-lock-backend-policy.js").AdvisoryLockBackendPolicyEntry[]} - Per-lock-name backend policy entries.
|
|
4326
4345
|
*/
|
|
4327
4346
|
getAdvisoryLockPolicy() {
|
|
4328
|
-
|
|
4347
|
+
const config = this.getAdvisoryLockConfig()
|
|
4348
|
+
const declaredPolicy = config.policy
|
|
4349
|
+
|
|
4350
|
+
if (!config.backends.lockServer.enabled) return declaredPolicy
|
|
4351
|
+
|
|
4352
|
+
// An undeclared hold must not silently pin a dedicated database session for
|
|
4353
|
+
// its whole duration, so a configured lock server serves it. `*` is the
|
|
4354
|
+
// shortest possible match, so every declared entry — a consumer's own
|
|
4355
|
+
// catch-all included — still wins for the names it covers.
|
|
4356
|
+
if (declaredPolicy.some((entry) => entry.name === "*")) {
|
|
4357
|
+
return [...declaredPolicy, ...FRAMEWORK_DB_NATIVE_ADVISORY_LOCK_POLICY]
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
return [
|
|
4361
|
+
...declaredPolicy,
|
|
4362
|
+
...FRAMEWORK_DB_NATIVE_ADVISORY_LOCK_POLICY,
|
|
4363
|
+
{minTier: "lock-server", name: "*", preferredTier: "lock-server"}
|
|
4364
|
+
]
|
|
4329
4365
|
}
|
|
4330
4366
|
|
|
4331
4367
|
/**
|