1.2 KiB
1.2 KiB
Mock Data Generation
Tinybird mock data flow (as implemented by the agent) for a datasource:
- Build a SQL query that returns mock rows.
- Execute locally with a limit and format using
tb --output=json|csv '<sql>' --rows-limit <rows>command. - Preview the generated output.
- Confirm creation of a fixture file under
fixtures/. - Write the fixture file:
fixtures/<datasource_name>.ndjsonorfixtures/<datasource_name>.csv
- Confirm append.
- Append the fixture to the datasource in Tinybird Local.
Example Mock Query
SELECT
rand() % 1000 AS experience_gained,
1 + rand() % 100 AS level,
rand() % 500 AS monster_kills,
concat('player_', toString(rand() % 10000)) AS player_id,
rand() % 50 AS pvp_kills,
rand() % 200 AS quest_completions,
now() - rand() % 86400 AS timestamp
FROM numbers(ROWS)
Notes:
- The query must return exactly
ROWSrows viaFROM numbers(ROWS). - Do not add FORMAT or a trailing semicolon in the mock query itself.
Error Handling Notes
- If the datasource is in quarantine, query
<datasource_name>_quarantineand surface the first 5 rows. - If append fails with "must be created first with 'mode=create'", rebuild the project and retry.