mirror of
https://github.com/better-auth/better-auth.git
synced 2026-06-09 16:28:45 -05:00
docs: update the db adapter content and keep the format consistent (#6402)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -4,12 +4,12 @@ description: 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](https://orm.drizzle.team/).
|
||||
|
||||
Before getting started, make sure you have Drizzle installed and configured. For more information, see [Drizzle Documentation](https://orm.drizzle.team/docs/overview/)
|
||||
|
||||
## Example Usage
|
||||
|
||||
Make sure you have Drizzle installed and configured.
|
||||
Then, you can use the Drizzle adapter to connect to your database.
|
||||
You can use the Drizzle adapter to connect to your database as follows.
|
||||
|
||||
```ts title="auth.ts"
|
||||
import { betterAuth } from "better-auth";
|
||||
@@ -150,6 +150,6 @@ export const auth = betterAuth({
|
||||
});
|
||||
```
|
||||
|
||||
## Performance Tips
|
||||
## Additional Information
|
||||
|
||||
If you're looking for performance improvements or tips, take a look at our guide to <Link href="/docs/guides/optimizing-for-performance">performance optimizations</Link>.
|
||||
- If you're looking for performance improvements or tips, take a look at our guide to <Link href="/docs/guides/optimizing-for-performance">performance optimizations</Link>.
|
||||
|
||||
@@ -4,12 +4,12 @@ description: Integrate Better Auth with MongoDB.
|
||||
---
|
||||
|
||||
MongoDB is a popular NoSQL database that is widely used for building scalable and flexible applications. It provides a flexible schema that allows for easy data modeling and querying.
|
||||
Read more here: [MongoDB](https://www.mongodb.com/).
|
||||
|
||||
Before getting started, make sure you have MongoDB installed and configured. For more information, see [MongoDB Documentation](https://www.mongodb.com/docs/)
|
||||
|
||||
## Example Usage
|
||||
|
||||
Make sure you have MongoDB installed and configured.
|
||||
Then, you can use the mongodb adapter.
|
||||
You can use the MongoDB adapter to connect to your database as follows.
|
||||
|
||||
```ts title="auth.ts"
|
||||
import { betterAuth } from "better-auth";
|
||||
@@ -46,3 +46,6 @@ export const auth = betterAuth({
|
||||
experimental: { joins: true }
|
||||
});
|
||||
```
|
||||
## Additional Information
|
||||
|
||||
- If you're looking for performance improvements or tips, take a look at our guide to <Link href="/docs/guides/optimizing-for-performance">performance optimizations</Link>.
|
||||
@@ -4,12 +4,12 @@ description: Integrate Better Auth with Prisma.
|
||||
---
|
||||
|
||||
Prisma ORM is an open-source database toolkit that simplifies database access and management in applications by providing a type-safe query builder and an intuitive data modeling interface.
|
||||
Read more [here](https://www.prisma.io/).
|
||||
|
||||
Before getting started, make sure you have Prisma installed and configured. For more information, see [Prisma Documentation](https://www.prisma.io/docs/)
|
||||
|
||||
## Example Usage
|
||||
|
||||
Make sure you have Prisma installed and configured.
|
||||
Then, you can use the Prisma adapter to connect to your database.
|
||||
You can use the Prisma adapter to connect to your database as follows.
|
||||
|
||||
```ts title="auth.ts"
|
||||
import { betterAuth } from "better-auth";
|
||||
@@ -26,7 +26,7 @@ export const auth = betterAuth({
|
||||
```
|
||||
|
||||
<Callout type="warning">
|
||||
If you have configured a custom output directory in your `schema.prisma` file (e.g., `output = "../src/generated/prisma"`), make sure to import the Prisma client from that location instead of `@prisma/client`. Learn more about custom output directories in the [Prisma documentation](https://www.prisma.io/docs/guides/nextjs#21-install-prisma-orm-and-create-your-first-models).
|
||||
Starting from Prisma 7, the `output` path field is required. If you have configured a custom output path in your `schema.prisma` file (e.g., `output = "../src/generated/prisma"`), make sure to import the Prisma client from that location instead of `@prisma/client`. For more information, see [here](https://www.prisma.io/docs/orm/prisma-client/setup-and-configuration/generating-prisma-client#the-location-of-prisma-client).
|
||||
</Callout>
|
||||
|
||||
## Schema generation & migration
|
||||
@@ -80,4 +80,5 @@ export const auth = betterAuth({
|
||||
|
||||
## Additional Information
|
||||
|
||||
If you're looking for performance improvements or tips, take a look at our guide to <Link href="/docs/guides/optimizing-for-performance">performance optimizations</Link>.
|
||||
- If you're looking for performance improvements or tips, take a look at our guide to <Link href="/docs/guides/optimizing-for-performance">performance optimizations</Link>.
|
||||
- [How to use Prisma ORM with Better Auth and Next.js](https://www.prisma.io/docs/guides/betterauth-nextjs)
|
||||
Reference in New Issue
Block a user