Installation
Usage
Define your database schema
Not every Effect
Schema is valid for use in Confect. See
Schema Restrictions for more
information about what’s permitted and what’s not.confect/tables/, where the filename is the table name (so filenames must be valid JS identifiers and may not start with _). Each file must default-export a Table; codegen reads module.default and applies the filename as the table name. From other modules (e.g. specs), default-import the codegen-emitted wrapper at confect/_generated/tables/<name> to reach the table’s derived Schemas (notes.Doc, notes.Fields).confect/tables/notes.ts
confect/tables/*.ts into a DatabaseSchema (in confect/_generated/schema.ts) and a Convex deploy SchemaDefinition (in confect/_generated/convexSchema.ts) for you — you never write a confect/schema.ts. It also emits a confect/_generated/id.ts module exporting a type-safe Id constructor (Id("notes")) for cross-table references.Implement your Confect functions
Create a
GroupImpl and implement its functions.confect/notes.impl.ts
GroupImpl.finalize only typechecks once every function declared by the spec has a corresponding FunctionImpl, so it acts as a per-group completeness check.Run confect codegen again to pick up the new impl.Start your Confect app
Run the In another terminal, run the
confect dev command to generate your app’s Convex functions.convex dev command to start your Convex dev deployment.