Launch Express uses Prisma ORM to interact with the database. Prisma is a modern database toolkit that makes it easy to interact with databases in Node.js and TypeScript.
Launch Express supports the following database providers:
To interact with the database, you can use the Prisma Client. The Prisma Client is an auto-generated and type-safe query builder that’s tailored to your database schema.
Copy
import prisma from "@/lib/db";const user = await prisma.user.findUnique({ where: { email: "john.doe@example.com", },});
If you want to include some additional Better-Auth plugins, you have to run the following command:
Copy
npx launch-express@latest generate-schema
That insures, that the schema is up to date and includes the additional plugins. After that you have to run the following command to generate the Prisma Client:
# Create a migrationnpx prisma migrate dev --name <migration-name># Reset databasenpx prisma migrate reset# View database in Prisma Studionpx prisma studio# Format schemanpx prisma format
I recommend using PostgreSQL as the database provider for your application, because it is a powerful, open-source object-relational database system.You can create a free PostgreSQL database by using Neon, Supabase or go with MongoDB and MongoDB Atlas.But you can also use other service providers like: