How the database and ORM are configured in zopio
.
zopio
aims to provide a robust, type-safe database client that makes it easy to work with your database while maintaining strong typing throughout your application. We aim to support tooling that:
zopio
uses Neon as its database provider and Prisma as its ORM. However, you can easily switch to other providers if you’d prefer, for example:
@repo/database
. You can import this package into any server-side component, like so:
packages/database/prisma/schema.prisma
. This schema file uses Prisma’s schema definition language to describe your database tables, relationships, and types.
Post
, describing a blog post. The blog content will be in a JSON format, generated by a library like Tiptap. To do this, we would add the following to your schema:
npx prisma format
to format the schema filenpx prisma generate
to generate the Prisma clientnpx prisma db push
to push the schema changes to the databasezopio
includes a visual database editor that allows you to view and edit your database records.