Schema location with crud helpers
I would like to use the CRUD helpers but it seems i have to define the table not in the schema.ts file, but according to the example, in the users.ts file. Is there a way to keep all the table definition,as per standard, in the schema.ts file and still use the helpers?Im referring to this example here
https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/README.md#crud-utilities
GitHub
convex-helpers/packages/convex-helpers/README.md at main · get-conv...
A collection of useful code to complement the official packages. - get-convex/convex-helpers
3 Replies
users.ts
is still exporting the table definition in the example there, and it's imported into schema.ts
. It's a useful pattern to have your table definitions in table-specific files, but if you prefer to keep the table definitions in schema.ts
, you can do so and individually export the Users
table definition to be imported by users.ts
.ok thanks, i thougt it was against the standard since all the example define all the tables in schema.ts
Yeah the schema must be the default export of
schema.ts
, but you can still define it anywhere and import it to schema.ts
.