This guide helps you quickly start using EdgeDB with Next.js, providing a basic schema and UI. Here are some next steps to get you up to speed.
The result of the query SELECT random() * 10
is: 5.01487324319001
Modify the query in app/page.tsx
to see the result of a different query.
Explore a list of resources to help you get started with EdgeDB and Next.js.
Extend the EdgeDB schema
schema.esdl
file and add your own types and fields. You can start by adding a Post
type with a title
and content
field. For example:type Post { # Add your new fields here: required title: str; required content: str; }
Create and run a migration
$ edgedb migration create $ edgedb migration apply
Generate TypeScript types
$ pnpm generate:all
Edit the EdgeDB query
app/page.tsx
file and update the query to include your new type. For example:const postsQuery = e.select(e.Post, (_post) => ({ id: true, title: true, content: true, // Add your other fields here }))
Deploy your app