rivet-cli 0.23.1

Rivet: PostgreSQL/MySQL/SQL Server/MongoDB → Parquet/CSV (local, S3, GCS, Azure). Crate name rivet-cli; binary rivet.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
[
  {
    "expect": "keyset(id)",
    "note": "large int-PK table (~163M rows) \u2192 keyset on the indexed PK",
    "table": {
      "schema": "s",
      "table": "big_int_pk_163m",
      "row_estimate": 163000000,
      "total_bytes": 90000000000,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "col_a",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(id)",
    "note": "huge int-PK table (~318M rows) \u2192 keyset stays flat-memory at any size",
    "table": {
      "schema": "s",
      "table": "huge_int_pk_318m",
      "row_estimate": 318000000,
      "total_bytes": 200000000000,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "amount",
          "data_type": "decimal",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": 11,
          "numeric_scale": 4
        }
      ]
    }
  },
  {
    "expect": "chunked(ref_id)",
    "note": "history/version table with a non-PK integer key (~823M rows) \u2192 range chunk on the integer key (no single PK \u2192 not keyset)",
    "table": {
      "schema": "s",
      "table": "version_ref_id_823m",
      "row_estimate": 823000000,
      "total_bytes": 400000000000,
      "columns": [
        {
          "name": "ref_id",
          "data_type": "bigint",
          "is_primary_key": false,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "version",
          "data_type": "int",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "updated_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "full",
    "note": "tiny table (~27 rows) \u2192 full is correct, no chunking overhead",
    "table": {
      "schema": "s",
      "table": "tiny_27",
      "row_estimate": 27,
      "total_bytes": 8192,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "col_a",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "full",
    "note": "small no-PK, no-cursor table (~50K rows) \u2192 full (below the 100k threshold anyway)",
    "table": {
      "schema": "s",
      "table": "small_no_key_50k",
      "row_estimate": 50000,
      "total_bytes": 3700000,
      "columns": [
        {
          "name": "col_a",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "col_b",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(id)",
    "note": "medium int-PK table just over the 100k threshold (~141K rows) \u2192 keyset, fast profile",
    "table": {
      "schema": "s",
      "table": "medium_int_pk_141k",
      "row_estimate": 141000,
      "total_bytes": 50000000,
      "columns": [
        {
          "name": "id",
          "data_type": "int",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "col_a",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "incremental(updated_at)",
    "note": "large table with NO usable single PK (a non-PK uuid column) but a timestamp cursor \u2192 incremental. Kept as the cursor-only path test after init learned to keyset a non-int single-PK: here the uuid is NOT a PK, so keysettable_pk_column is None and the cursor wins.",
    "table": {
      "schema": "s",
      "table": "large_cursor_only_2m",
      "row_estimate": 2000000,
      "total_bytes": 800000000,
      "columns": [
        {
          "name": "uuid",
          "data_type": "char",
          "is_primary_key": false,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "updated_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "full",
    "note": "KNOWN GAP: small-by-count (~25K rows) but MB-wide rows (large text columns). Scaffolded full because the 100k threshold is row-count-blind to row WIDTH; a full scan of MB rows times out. It has an integer PK, so it SHOULD keyset(id). Flip to keyset(id) when init weighs total_bytes.",
    "table": {
      "schema": "s",
      "table": "wide_short_25k",
      "row_estimate": 25000,
      "total_bytes": 21474836480,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "wide_text_a",
          "data_type": "longtext",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "wide_text_b",
          "data_type": "longtext",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(id)",
    "note": "distilled field-fleet profile: a bigint-PK feed table with BOTH created_at + updated_at, ~3M rows / ~1GB, in a non-default schema. The field tool chose a size-tiered timestamp strategy; rivet picks keyset(id) \u2014 the single-column PK beats the timestamp cursor, and keyset stays flat-memory regardless of size. Locks 'PK wins over a present cursor'.",
    "table": {
      "schema": "ext",
      "table": "bigint_pk_dual_ts_3m",
      "row_estimate": 3000000,
      "total_bytes": 1000000000,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "payload",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "created_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "updated_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(id)",
    "note": "distilled field-fleet profile: the INT-PK minority (a minority of the fleet's tables are int, not bigint), ~500K rows, dual timestamps. Same decision as the bigint majority \u2014 keyset(id) on the integer PK. Locks that int and bigint PKs route identically.",
    "table": {
      "schema": "ext",
      "table": "int_pk_dual_ts_500k",
      "row_estimate": 500000,
      "total_bytes": 180000000,
      "columns": [
        {
          "name": "id",
          "data_type": "int",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "payload",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "created_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "updated_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(id)",
    "note": "distilled field-fleet profile: a very large bigint-PK feed table (~200M rows) whose ids run PAST i64::MAX \u2014 the field DB CASTs id AS UNSIGNED (BIGINT UNSIGNED). The STRATEGY is keyset(id) like any bigint PK; the unsigned-cursor RUNTIME hazard (extract_last_cursor_value, fixed in bc512a3) is exercised by the live stand, not this offline oracle.",
    "table": {
      "schema": "ext",
      "table": "bigint_unsigned_pk_200m",
      "row_estimate": 200000000,
      "total_bytes": 120000000000,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "payload",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "full",
    "note": "distilled field-fleet profile: a SMALL keyed feed table (~80K rows, below the 100k chunked threshold) with dual timestamps. Even with a bigint PK it scaffolds full \u2014 no chunking overhead under the threshold. Locks 'a PK does not force keyset below the row threshold'.",
    "table": {
      "schema": "ext",
      "table": "bigint_pk_small_80k",
      "row_estimate": 80000,
      "total_bytes": 24000000,
      "columns": [
        {
          "name": "id",
          "data_type": "bigint",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "payload",
          "data_type": "varchar",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "created_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "updated_at",
          "data_type": "timestamp",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(id)",
    "note": "NON-INT single-column PK #1 \u2014 UUID PK, ~150K rows. Init now scaffolds keyset(id): a uuid PK is a keyset-usable key, so a large uuid-PK table pages by ROWS (chunk_by_key) instead of an unbounded full scan (durability-safe per ADR-0020's explicit chunk_by_key path). Dogfood-confirmed on PG/MySQL/MSSQL. RED-proves the suggest_mode keysettable-PK fix.",
    "table": {
      "schema": "s",
      "table": "uuid_pk_150k",
      "row_estimate": 150000,
      "total_bytes": 30000000,
      "columns": [
        {
          "name": "id",
          "data_type": "uuid",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "name",
          "data_type": "text",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "keyset(code)",
    "note": "NON-INT single-column PK #2 \u2014 STRING (varchar) PK, ~150K rows. Init now scaffolds keyset(code): a varchar PK is a keyset-usable key. Same fix as the uuid case.",
    "table": {
      "schema": "s",
      "table": "string_pk_150k",
      "row_estimate": 150000,
      "total_bytes": 20000000,
      "columns": [
        {
          "name": "code",
          "data_type": "varchar",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        },
        {
          "name": "name",
          "data_type": "text",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "full",
    "note": "NON-INT single-column PK #3 \u2014 DECIMAL(20,0) PK, ~150K rows. Init correctly scaffolds `full`, NOT keyset: a DECIMAL keyset key is refused at plan time (the keyset cursor excludes decimal/numeric), so init must NOT scaffold chunk_by_key on it (would fail the run). is_keysettable_type excludes decimal, so a decimal PK stays full (or range-chunks an integer column if present). Locks that the keyset fix does NOT over-reach to decimal.",
    "table": {
      "schema": "s",
      "table": "decimal_pk_150k",
      "row_estimate": 150000,
      "total_bytes": 20000000,
      "columns": [
        {
          "name": "id",
          "data_type": "decimal",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": 20,
          "numeric_scale": 0
        },
        {
          "name": "name",
          "data_type": "text",
          "is_primary_key": false,
          "is_nullable": true,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  },
  {
    "expect": "chunked(seq)",
    "note": "DECIMAL PK but WITH an integer non-PK column, ~200K rows. init range-chunks the integer column (chunk_column: seq), NEVER keysets the decimal PK (planner refuses a decimal keyset key). Locks that keysettable_pk_column gates the keyset branch \u2014 a decimal PK does not hijack it when a range-chunkable int column exists.",
    "table": {
      "schema": "s",
      "table": "decimal_pk_with_int_col_200k",
      "row_estimate": 200000,
      "total_bytes": 40000000,
      "columns": [
        {
          "name": "id",
          "data_type": "decimal",
          "is_primary_key": true,
          "is_nullable": false,
          "numeric_precision": 20,
          "numeric_scale": 0
        },
        {
          "name": "seq",
          "data_type": "int",
          "is_primary_key": false,
          "is_nullable": false,
          "numeric_precision": null,
          "numeric_scale": null
        }
      ]
    }
  }
]