@gscdump/engine 0.20.0 → 0.20.2

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.
@@ -127,10 +127,13 @@ declare function rollupParquetKey(ctx: TenantCtx, id: string, builtAt: number, s
127
127
  interface RollupBucket {
128
128
  list: (opts: {
129
129
  prefix: string;
130
+ cursor?: string;
130
131
  }) => Promise<{
131
132
  objects: Array<{
132
133
  key: string;
133
134
  }>;
135
+ truncated?: boolean;
136
+ cursor?: string;
134
137
  }>;
135
138
  get: (key: string) => Promise<{
136
139
  text: () => Promise<string>;
package/dist/rollups.mjs CHANGED
@@ -15,18 +15,25 @@ function rollupParquetKey(ctx, id, builtAt, searchType) {
15
15
  const ROLLUP_FILE_RE = /^(?<id>[a-z0-9_]+)__v(?<ts>\d+)\.json$/;
16
16
  async function readLatestRollup(bucket, ctx, id, searchType) {
17
17
  const prefix = `${rollupPrefix(ctx, searchType)}/`;
18
- const listing = await bucket.list({ prefix }).catch(() => null);
19
- if (!listing) return null;
20
18
  let newest = null;
21
- for (const obj of listing.objects) {
22
- const m = ROLLUP_FILE_RE.exec(obj.key.slice(prefix.length));
23
- if (!m?.groups || m.groups.id !== id) continue;
24
- const ts = Number(m.groups.ts);
25
- if (!newest || ts > newest.ts) newest = {
26
- ts,
27
- key: obj.key
28
- };
29
- }
19
+ let cursor;
20
+ do {
21
+ const listing = await bucket.list({
22
+ prefix,
23
+ cursor
24
+ }).catch(() => null);
25
+ if (!listing) return null;
26
+ for (const obj of listing.objects) {
27
+ const m = ROLLUP_FILE_RE.exec(obj.key.slice(prefix.length));
28
+ if (!m?.groups || m.groups.id !== id) continue;
29
+ const ts = Number(m.groups.ts);
30
+ if (!newest || ts > newest.ts) newest = {
31
+ ts,
32
+ key: obj.key
33
+ };
34
+ }
35
+ cursor = listing.truncated ? listing.cursor : void 0;
36
+ } while (cursor !== void 0);
30
37
  if (!newest) return null;
31
38
  const obj = await bucket.get(newest.key).catch(() => null);
32
39
  if (!obj) return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/engine",
3
3
  "type": "module",
4
- "version": "0.20.0",
4
+ "version": "0.20.2",
5
5
  "description": "Append-only Parquet/DuckDB storage engine + planner + adapters for the gscdump pipeline. Node + edge runtimes; opt-in heavy peers.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -169,8 +169,8 @@
169
169
  "dependencies": {
170
170
  "drizzle-orm": "^0.45.2",
171
171
  "proper-lockfile": "^4.1.2",
172
- "@gscdump/contracts": "0.20.0",
173
- "gscdump": "0.20.0"
172
+ "@gscdump/contracts": "0.20.2",
173
+ "gscdump": "0.20.2"
174
174
  },
175
175
  "devDependencies": {
176
176
  "@duckdb/duckdb-wasm": "^1.32.0",
@@ -178,7 +178,7 @@
178
178
  "aws4fetch": "^1.0.20",
179
179
  "hyparquet": "^1.25.8",
180
180
  "hyparquet-writer": "^0.15.1",
181
- "tsx": "^4.22.2",
181
+ "tsx": "^4.22.3",
182
182
  "vitest": "^4.1.6"
183
183
  },
184
184
  "scripts": {