@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 CHANGED
@@ -242,6 +242,13 @@ var TYPE_MAP = {
242
242
  timestamp: "TIMESTAMPTZ",
243
243
  jsonb: "JSONB"
244
244
  };
245
+ var MAX_IDENT_BYTES = 63;
246
+ function safeIndexName(name) {
247
+ if (name.length <= MAX_IDENT_BYTES)
248
+ return name;
249
+ const hash = createHash("sha256").update(name).digest("hex").slice(0, 8);
250
+ return `${name.slice(0, MAX_IDENT_BYTES - hash.length - 1)}_${hash}`;
251
+ }
245
252
  function escapeLiteralDefault(value) {
246
253
  if (value === null || value === undefined)
247
254
  return "NULL";
@@ -284,6 +291,7 @@ function emitTableDDL(schemaName, tableName, tableDef) {
284
291
  for (const [colName, col] of Object.entries(tableDef.columns)) {
285
292
  if (col.indexed) {
286
293
  statements.push(`CREATE INDEX IF NOT EXISTS ${quotePgIdent(`idx_${schemaName}_${tableName}_${colName}`)} ON ${qualifiedName} (${quotePgIdent(colName)})`);
294
+ statements.push(`CREATE INDEX IF NOT EXISTS ${quotePgIdent(safeIndexName(`idx_${schemaName}_${tableName}_${colName}_id`))} ON ${qualifiedName} (${quotePgIdent(colName)}, ${quotePgIdent("_id")})`);
287
295
  }
288
296
  }
289
297
  for (const [colName, col] of Object.entries(tableDef.columns)) {
@@ -2805,6 +2813,10 @@ async function resolveRoute(subgraphName, targetDb) {
2805
2813
  version: row?.version ?? ""
2806
2814
  };
2807
2815
  routeCache.set(subgraphName, route);
2816
+ logger7.info("subgraph handler dispatch path resolved", {
2817
+ subgraph: subgraphName,
2818
+ path: sandboxEnabled({ sandbox_workers: route.sandboxWorkers }) ? "sandbox" : "in-process"
2819
+ });
2808
2820
  return route;
2809
2821
  }
2810
2822
  function invalidateSubgraphRoute(subgraphName) {
@@ -5074,5 +5086,5 @@ export {
5074
5086
  ByoBreakingChangeError
5075
5087
  };
5076
5088
 
5077
- //# debugId=AD9497F805C348C364756E2164756E21
5089
+ //# debugId=8CAA9C7AD1208F2564756E2164756E21
5078
5090
  //# sourceMappingURL=index.js.map