@secondlayer/subgraphs 3.26.4 → 4.0.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.
@@ -323,16 +323,14 @@ class SubgraphContext {
323
323
  pgSchemaName;
324
324
  subgraphSchema;
325
325
  ops = [];
326
- byo;
327
326
  journal;
328
327
  _client;
329
- constructor(db, pgSchemaName2, subgraphSchema, block, tx, byo = false, journal = false) {
328
+ constructor(db, pgSchemaName2, subgraphSchema, block, tx, journal = false) {
330
329
  this.db = db;
331
330
  this.pgSchemaName = pgSchemaName2;
332
331
  this.subgraphSchema = subgraphSchema;
333
332
  this.block = block;
334
333
  this._tx = tx;
335
- this.byo = byo;
336
334
  this.journal = journal;
337
335
  }
338
336
  get client() {
@@ -701,15 +699,6 @@ class SubgraphContext {
701
699
  }
702
700
  buildStatements(ops) {
703
701
  const statements = [];
704
- if (this.byo) {
705
- const insertTables = new Set;
706
- for (const op of ops)
707
- if (op.kind === "insert")
708
- insertTables.add(op.table);
709
- for (const table of insertTables) {
710
- statements.push(`DELETE FROM "${this.pgSchemaName}"."${table}" WHERE "_block_height" = ${this.block.height}`);
711
- }
712
- }
713
702
  let currentBatch = null;
714
703
  let currentBatchKey = "";
715
704
  let incBatch = null;
@@ -1426,7 +1415,7 @@ function defaultTx(overrides = {}) {
1426
1415
  class InMemorySubgraphContext extends SubgraphContext {
1427
1416
  store = new Map;
1428
1417
  constructor(schema, block, tx) {
1429
- super(undefined, TEST_SCHEMA_NAME, schema, block, tx, false, false);
1418
+ super(undefined, TEST_SCHEMA_NAME, schema, block, tx, false);
1430
1419
  }
1431
1420
  async readRows(table, where, limit) {
1432
1421
  const rows = (this.store.get(table) ?? []).filter((row) => Object.entries(where).every(([k, v]) => sameValue(row[k], v)));
@@ -1508,5 +1497,5 @@ export {
1508
1497
  buildEvent
1509
1498
  };
1510
1499
 
1511
- //# debugId=3F4FE3C65A2091B064756E2164756E21
1500
+ //# debugId=F28CFCCFD7CC80FA64756E2164756E21
1512
1501
  //# sourceMappingURL=index.js.map