@secondlayer/subgraphs 3.12.0 → 3.13.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.
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.js +531 -180
- package/dist/src/index.js.map +10 -10
- package/dist/src/runtime/block-processor.d.ts +31 -1
- package/dist/src/runtime/block-processor.js +501 -72
- package/dist/src/runtime/block-processor.js.map +9 -8
- package/dist/src/runtime/catchup.d.ts +7 -0
- package/dist/src/runtime/catchup.js +520 -118
- package/dist/src/runtime/catchup.js.map +10 -9
- package/dist/src/runtime/context.d.ts +65 -3
- package/dist/src/runtime/context.js +390 -8
- package/dist/src/runtime/context.js.map +6 -4
- package/dist/src/runtime/processor.js +576 -229
- package/dist/src/runtime/processor.js.map +12 -12
- package/dist/src/runtime/reindex.d.ts +7 -0
- package/dist/src/runtime/reindex.js +531 -180
- package/dist/src/runtime/reindex.js.map +10 -10
- package/dist/src/runtime/reorg.d.ts +7 -0
- package/dist/src/runtime/reorg.js +521 -73
- package/dist/src/runtime/reorg.js.map +10 -9
- package/dist/src/runtime/replay.js.map +2 -2
- package/dist/src/runtime/runner.d.ts +70 -2
- package/dist/src/runtime/runner.js +56 -58
- package/dist/src/runtime/runner.js.map +3 -3
- package/dist/src/runtime/source-matcher.d.ts +2 -0
- package/dist/src/runtime/source-matcher.js.map +2 -2
- package/dist/src/schema/index.d.ts +7 -0
- package/dist/src/schema/index.js +18 -1
- package/dist/src/schema/index.js.map +3 -3
- package/dist/src/service.js +576 -229
- package/dist/src/service.js.map +12 -12
- package/dist/src/types.d.ts +7 -0
- package/dist/src/validate.d.ts +7 -0
- package/package.json +1 -1
package/dist/src/types.d.ts
CHANGED
|
@@ -206,6 +206,13 @@ interface SubgraphContext {
|
|
|
206
206
|
update(table: string, where: Record<string, unknown>, set: Record<string, unknown>): void;
|
|
207
207
|
upsert(table: string, key: Record<string, unknown>, row: Record<string, unknown>): void;
|
|
208
208
|
delete(table: string, where: Record<string, unknown>): void;
|
|
209
|
+
/**
|
|
210
|
+
* Atomic counter update — the blessed accumulator primitive. Applies
|
|
211
|
+
* `col = COALESCE(col, 0) + delta` per column (insert-or-add); deltas may
|
|
212
|
+
* be negative. Requires a uniqueKeys constraint matching `key`. Prefer
|
|
213
|
+
* this over patchOrInsert with functional updaters for running totals.
|
|
214
|
+
*/
|
|
215
|
+
increment(table: string, key: Record<string, unknown>, deltas: Record<string, bigint | number>): void;
|
|
209
216
|
/** Partial update — sets only specified fields, preserves others */
|
|
210
217
|
patch(table: string, where: Record<string, unknown>, set: Record<string, unknown>): void;
|
|
211
218
|
/** Find-then-merge-or-insert. Values can be functions: (existing) => newValue */
|
package/dist/src/validate.d.ts
CHANGED
|
@@ -165,6 +165,13 @@ interface SubgraphContext {
|
|
|
165
165
|
update(table: string, where: Record<string, unknown>, set: Record<string, unknown>): void;
|
|
166
166
|
upsert(table: string, key: Record<string, unknown>, row: Record<string, unknown>): void;
|
|
167
167
|
delete(table: string, where: Record<string, unknown>): void;
|
|
168
|
+
/**
|
|
169
|
+
* Atomic counter update — the blessed accumulator primitive. Applies
|
|
170
|
+
* `col = COALESCE(col, 0) + delta` per column (insert-or-add); deltas may
|
|
171
|
+
* be negative. Requires a uniqueKeys constraint matching `key`. Prefer
|
|
172
|
+
* this over patchOrInsert with functional updaters for running totals.
|
|
173
|
+
*/
|
|
174
|
+
increment(table: string, key: Record<string, unknown>, deltas: Record<string, bigint | number>): void;
|
|
168
175
|
/** Partial update — sets only specified fields, preserves others */
|
|
169
176
|
patch(table: string, where: Record<string, unknown>, set: Record<string, unknown>): void;
|
|
170
177
|
/** Find-then-merge-or-insert. Values can be functions: (existing) => newValue */
|