Resource
A resource is a collection of data that is stored in the database. For models that don't require a
frontend interface, you can use the resource generator to create a simple resource. For existing
models, the fields option can be omitted and the generator will use the existing fields.
Syntax
$ vela generate resource <name> [fields...] $ vela generate resource categories name:string This will create a database model and a Zod schema definition for the resource.
The files
created are:
src/lib/schemas/category.ts
migrations/created_categories.ts
AI
ProThe generate resource command supports the --ai option for freeform text input in place
of specifying the fields.
$ vela generate resource categories --ai "book categories"