@secondlayer/subgraphs 3.24.3 → 3.25.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/dist/src/index.js +13 -1
- package/dist/src/index.js.map +4 -4
- package/dist/src/runtime/block-processor.js +13 -1
- package/dist/src/runtime/block-processor.js.map +4 -4
- package/dist/src/runtime/catchup.js +13 -1
- package/dist/src/runtime/catchup.js.map +4 -4
- package/dist/src/runtime/context.js +9 -1
- package/dist/src/runtime/context.js.map +3 -3
- package/dist/src/runtime/processor.js +13 -1
- package/dist/src/runtime/processor.js.map +4 -4
- package/dist/src/runtime/reindex.js +13 -1
- package/dist/src/runtime/reindex.js.map +4 -4
- package/dist/src/runtime/reorg.js +13 -1
- package/dist/src/runtime/reorg.js.map +4 -4
- package/dist/src/schema/index.js +9 -1
- package/dist/src/schema/index.js.map +3 -3
- package/dist/src/service.js +13 -1
- package/dist/src/service.js.map +4 -4
- package/dist/src/testing/index.js +9 -1
- package/dist/src/testing/index.js.map +3 -3
- package/package.json +1 -1
|
@@ -27,6 +27,13 @@ var TYPE_MAP = {
|
|
|
27
27
|
timestamp: "TIMESTAMPTZ",
|
|
28
28
|
jsonb: "JSONB"
|
|
29
29
|
};
|
|
30
|
+
var MAX_IDENT_BYTES = 63;
|
|
31
|
+
function safeIndexName(name) {
|
|
32
|
+
if (name.length <= MAX_IDENT_BYTES)
|
|
33
|
+
return name;
|
|
34
|
+
const hash = createHash("sha256").update(name).digest("hex").slice(0, 8);
|
|
35
|
+
return `${name.slice(0, MAX_IDENT_BYTES - hash.length - 1)}_${hash}`;
|
|
36
|
+
}
|
|
30
37
|
function escapeLiteralDefault(value) {
|
|
31
38
|
if (value === null || value === undefined)
|
|
32
39
|
return "NULL";
|
|
@@ -69,6 +76,7 @@ function emitTableDDL(schemaName, tableName, tableDef) {
|
|
|
69
76
|
for (const [colName, col] of Object.entries(tableDef.columns)) {
|
|
70
77
|
if (col.indexed) {
|
|
71
78
|
statements.push(`CREATE INDEX IF NOT EXISTS ${quotePgIdent(`idx_${schemaName}_${tableName}_${colName}`)} ON ${qualifiedName} (${quotePgIdent(colName)})`);
|
|
79
|
+
statements.push(`CREATE INDEX IF NOT EXISTS ${quotePgIdent(safeIndexName(`idx_${schemaName}_${tableName}_${colName}_id`))} ON ${qualifiedName} (${quotePgIdent(colName)}, ${quotePgIdent("_id")})`);
|
|
72
80
|
}
|
|
73
81
|
}
|
|
74
82
|
for (const [colName, col] of Object.entries(tableDef.columns)) {
|
|
@@ -2590,6 +2598,10 @@ async function resolveRoute(subgraphName, targetDb) {
|
|
|
2590
2598
|
version: row?.version ?? ""
|
|
2591
2599
|
};
|
|
2592
2600
|
routeCache.set(subgraphName, route);
|
|
2601
|
+
logger7.info("subgraph handler dispatch path resolved", {
|
|
2602
|
+
subgraph: subgraphName,
|
|
2603
|
+
path: sandboxEnabled({ sandbox_workers: route.sandboxWorkers }) ? "sandbox" : "in-process"
|
|
2604
|
+
});
|
|
2593
2605
|
return route;
|
|
2594
2606
|
}
|
|
2595
2607
|
function invalidateSubgraphRoute(subgraphName) {
|
|
@@ -3569,5 +3581,5 @@ export {
|
|
|
3569
3581
|
backfillSubgraph
|
|
3570
3582
|
};
|
|
3571
3583
|
|
|
3572
|
-
//# debugId=
|
|
3584
|
+
//# debugId=9F4CFC4A2A15675F64756E2164756E21
|
|
3573
3585
|
//# sourceMappingURL=reindex.js.map
|