Generate fixture data for testing and development.
Syntax
$ vela fixtures generateThis will generate fixture files in the data/fixtures directory. The order of files is determined by the database schema — collections that depend on other collections are written later.
Data is generated from the database schema with json-schema-faker and Faker. Autodate and file fields are skipped — PocketBase fills the first, and files need real content. Numbers respect the field’s own settings: its minimum and maximum, and whole numbers only when the field says so. A number field with no limits gets a whole number from 0 to 1000 rather than any float, and a required field is never left blank. Relation fields point at records generated earlier in the run or at seed records, so a collection that requires a relation to a seeded one still produces fixtures that load.
Options
-c, --count <count>- Number of records per collection, between 1 and 999. Defaults to10.--count-for <collection=count...>- Records for one collection, overriding--count. Repeat it or list several--only <collections...>- Generate for these collections only, leaving the other fixture files as they are--skip <collections...>- Leave these collections out, and their fixture files as they are-s, --seed <seed>- Integer seed for deterministic output-f, --force- Overwrite existing fixture files and clear loaded fixtures
$ vela fixtures generate --count 50 --seed 1234Passing the same --seed produces the same records every time, which keeps test failures reproducible. Without --force, existing fixture files are left alone.
Choosing collections
$ vela fixtures generate --count-for songs=64 participants=13
$ vela fixtures generate --only songs --force
$ vela fixtures generate --skip audit_logs--count-for sets the number of records for the collections it names; the rest get --count. A run narrowed with --only or --skip rewrites only the files of the collections it generates and leaves every other fixture file alone, so one collection can be regenerated without disturbing the rest.
Collections the app fills itself are left out, since records invented for them would be wrong: oauth_accounts, api_keys, stripe_customers, stripe_payment_methods, stripe_products, stripe_prices, stripe_subscriptions, team_invites and team_invite_links. The command says which it left out. Name one with --only to generate records for it anyway.
AI
An --ai option for more realistic generated data is planned. It is not available today — vela fixtures generate takes only the options above.