
convex-schema-validator
Designs convex/schema.ts tables, validators, indexes, and relationships
by waynesuttonFree
Description
ts file in a Convex app. It defines tables, validators, indexes and relationships, and it aims to keep the schema accurate as the data changes. The output is a schema that types every document, indexes every query path, and passes validation against the data already in the database. index() in the schema, named after its fields and queried in field order. filter() and would be better served by an index. id. It is the place to start when npx convex dev fails with a schema validation error. The skill's skeleton imports defineSchema and defineTable from convex/server and the v validator from convex/values. 9K installs, and its security audits all pass.…
Highlights
- Designs convex/schema.ts tables and validators
- Index rule for every withIndex query
- Embed versus link with v.id guidance
- Helps fix schema validation errors
- Checks the schema against existing data
Ratings & Reviews
No ratings yet
Be the first to rate convex-schema-validator.
People also visit
convex-schema-validator FAQ
When should I use it?
When creating a table, adding a field, replacing a filter with an index, deciding between embedding and linking, or when npx convex dev fails with a schema validation error.
What is the main rule?
Every withIndex in a function needs a matching .index() in the schema, named after its fields and queried in field order.
Does it check existing data?
Yes. The schema is meant to pass validation against the data already in the database.
Does it cover relationships?
Yes. It covers when to embed an object and when to link to another document with v.id.
What imports does the schema use?
defineSchema and defineTable from convex/server, and the v validator from convex/values.
What are the best convex-schema-validator alternatives?
Popular alternatives to convex-schema-validator include convex-reviewer, convex-expert and convex-migration-helper. See all convex-schema-validator alternatives



