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
# Rivet Example: MySQL → Incremental Export → Local Parquet
#
# Use case: hourly sync of new order rows from MySQL.
# Run: rivet run -c examples/mysql_incremental_local.yaml --validate
source:
type: mysql
url_env: DATABASE_URL
tuning:
profile: balanced
exports:
- name: orders_incremental
query: >
SELECT id, user_id, product, quantity, price,
status, ordered_at, updated_at
FROM orders
mode: incremental
# cursor_column must be monotonically increasing.
# For append-only tables, 'id' (auto-increment) works well.
# For tables with updates, use 'updated_at'.
cursor_column: id
format: parquet
compression: zstd
skip_empty: true # no file on runs with no new orders
# MySQL does not expose `DECIMAL` precision/scale via column metadata;
# declare it explicitly so the export schema is stable run-to-run.
columns:
price: decimal(10,2)
quality:
row_count_min: 0 # first run OK with 0 new rows
unique_columns:
- id # verify no duplicate IDs
destination:
type: local
path: ./output