Drizzle ORM Adapter
Integrate Better Auth with Drizzle ORM.
Drizzle ORM is a powerful and flexible ORM for Node.js and TypeScript. It provides a simple and intuitive API for working with databases, and supports a wide range of databases including MySQL, PostgreSQL, SQLite, and more. Read more here: Drizzle ORM.
Example Usage
Make sure you have Drizzle installed and configured. Then, you can use the Drizzle adapter to connect to your database.
Schema generation & migration
The Better Auth CLI allows you to generate or migrate your database schema based on your Better Auth configuration and plugins.
Drizzle Schema Generation | Drizzle Schema Migration |
|---|---|
| ✅ Supported | ❌ Not Supported - Use Drizzle migration command |
Additional Information
The Drizzle adapter expects the schema you define to match the table names. For example, if your Drizzle schema maps the user table to users, you need to manually pass the schema and map it to the user table.
If you're looking for performance improvements or tips, take a look at our guide to performance optimizations.