graphile-storage-registry 0.1.0 → 0.1.1
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/esm/index.d.ts +1 -0
- package/esm/index.js +1 -0
- package/esm/physical-bucket.d.ts +10 -0
- package/esm/physical-bucket.js +14 -0
- package/index.d.ts +1 -0
- package/index.js +3 -1
- package/package.json +2 -2
- package/physical-bucket.d.ts +10 -0
- package/physical-bucket.js +17 -0
package/esm/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export type { StorageInflection, UploadSurfaceNames } from './naming';
|
|
|
2
2
|
export { DOWNLOAD_URL_FIELD, uploadSurfaceNames } from './naming';
|
|
3
3
|
export type { StorageCodec, StorageCodecAttributes, StorageCodecRelation, StoragePgRegistry, StoragePlanePair, } from './pairing';
|
|
4
4
|
export { discoverStoragePlanes, pairStoragePlane } from './pairing';
|
|
5
|
+
export { recordPhysicalName } from './physical-bucket';
|
package/esm/index.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record the authoritative physical bucket coordinate on a bucket row.
|
|
3
|
+
*
|
|
4
|
+
* The caller supplies the query runner so each storage lane can preserve its
|
|
5
|
+
* own database-client and claims behavior.
|
|
6
|
+
*/
|
|
7
|
+
export declare function recordPhysicalName(query: (query: {
|
|
8
|
+
text: string;
|
|
9
|
+
values: unknown[];
|
|
10
|
+
}) => Promise<unknown>, bucketsQualifiedName: string, bucketId: string, physicalName: string): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record the authoritative physical bucket coordinate on a bucket row.
|
|
3
|
+
*
|
|
4
|
+
* The caller supplies the query runner so each storage lane can preserve its
|
|
5
|
+
* own database-client and claims behavior.
|
|
6
|
+
*/
|
|
7
|
+
export async function recordPhysicalName(query, bucketsQualifiedName, bucketId, physicalName) {
|
|
8
|
+
await query({
|
|
9
|
+
text: `UPDATE ${bucketsQualifiedName}
|
|
10
|
+
SET physical_name = $1
|
|
11
|
+
WHERE id = $2 AND physical_name IS NULL`,
|
|
12
|
+
values: [physicalName, bucketId],
|
|
13
|
+
});
|
|
14
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export type { StorageInflection, UploadSurfaceNames } from './naming';
|
|
|
2
2
|
export { DOWNLOAD_URL_FIELD, uploadSurfaceNames } from './naming';
|
|
3
3
|
export type { StorageCodec, StorageCodecAttributes, StorageCodecRelation, StoragePgRegistry, StoragePlanePair, } from './pairing';
|
|
4
4
|
export { discoverStoragePlanes, pairStoragePlane } from './pairing';
|
|
5
|
+
export { recordPhysicalName } from './physical-bucket';
|
package/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pairStoragePlane = exports.discoverStoragePlanes = exports.uploadSurfaceNames = exports.DOWNLOAD_URL_FIELD = void 0;
|
|
3
|
+
exports.recordPhysicalName = exports.pairStoragePlane = exports.discoverStoragePlanes = exports.uploadSurfaceNames = exports.DOWNLOAD_URL_FIELD = void 0;
|
|
4
4
|
var naming_1 = require("./naming");
|
|
5
5
|
Object.defineProperty(exports, "DOWNLOAD_URL_FIELD", { enumerable: true, get: function () { return naming_1.DOWNLOAD_URL_FIELD; } });
|
|
6
6
|
Object.defineProperty(exports, "uploadSurfaceNames", { enumerable: true, get: function () { return naming_1.uploadSurfaceNames; } });
|
|
7
7
|
var pairing_1 = require("./pairing");
|
|
8
8
|
Object.defineProperty(exports, "discoverStoragePlanes", { enumerable: true, get: function () { return pairing_1.discoverStoragePlanes; } });
|
|
9
9
|
Object.defineProperty(exports, "pairStoragePlane", { enumerable: true, get: function () { return pairing_1.pairStoragePlane; } });
|
|
10
|
+
var physical_bucket_1 = require("./physical-bucket");
|
|
11
|
+
Object.defineProperty(exports, "recordPhysicalName", { enumerable: true, get: function () { return physical_bucket_1.recordPhysicalName; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphile-storage-registry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Registry-derived storage plane discovery for PostGraphile v5 — pairs @storageFiles/@storageBuckets codecs through their actual foreign-key relations and derives the canonical upload surface names, so no table name is ever load-bearing",
|
|
5
5
|
"author": "Constructive <developers@constructive.io>",
|
|
6
6
|
"homepage": "https://github.com/constructive-io/constructive",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"postgres",
|
|
43
43
|
"graphql"
|
|
44
44
|
],
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "7e6cc68f5659d12ec852835a7d8fcca6b05a8f50"
|
|
46
46
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record the authoritative physical bucket coordinate on a bucket row.
|
|
3
|
+
*
|
|
4
|
+
* The caller supplies the query runner so each storage lane can preserve its
|
|
5
|
+
* own database-client and claims behavior.
|
|
6
|
+
*/
|
|
7
|
+
export declare function recordPhysicalName(query: (query: {
|
|
8
|
+
text: string;
|
|
9
|
+
values: unknown[];
|
|
10
|
+
}) => Promise<unknown>, bucketsQualifiedName: string, bucketId: string, physicalName: string): Promise<void>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recordPhysicalName = recordPhysicalName;
|
|
4
|
+
/**
|
|
5
|
+
* Record the authoritative physical bucket coordinate on a bucket row.
|
|
6
|
+
*
|
|
7
|
+
* The caller supplies the query runner so each storage lane can preserve its
|
|
8
|
+
* own database-client and claims behavior.
|
|
9
|
+
*/
|
|
10
|
+
async function recordPhysicalName(query, bucketsQualifiedName, bucketId, physicalName) {
|
|
11
|
+
await query({
|
|
12
|
+
text: `UPDATE ${bucketsQualifiedName}
|
|
13
|
+
SET physical_name = $1
|
|
14
|
+
WHERE id = $2 AND physical_name IS NULL`,
|
|
15
|
+
values: [physicalName, bucketId],
|
|
16
|
+
});
|
|
17
|
+
}
|