Getting started

Installation

npm install @rjdellecese/confect
yarn add @rjdellecese/confect
pnpm add @rjdellecese/confect

exactOptionalPropertyTypes

Normally when using the Effect schema library, it's recommended to set exactOptionalPropertyTypes in your tsconfig.json to true. However, this configuration is not supported by convex-js at the moment, so to use Confect, you must set it to false instead.

To understand the implications of this, see this explanationarrow-up-right in the Effect docs.

Usage

1. Define your database schema

circle-info

Not every Effect Schema is valid for use in Confect. See Schema restrictions for more information about what's permitted and what's not.

https://github.com/rjdellecese/confect/blob/main/example/convex/schema.ts

2. Generate your Convex function constructors and types.

https://github.com/rjdellecese/confect/blob/main/example/convex/confect.ts

3. Write some Convex functions!

https://github.com/rjdellecese/confect/blob/main/example/convex/functions.ts

Example project

The above files are pulled from a real example project. Check it out herearrow-up-right.

Last updated