Skip to content

Commit

Permalink
Update docs (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper authored Nov 6, 2023
1 parent 73d358d commit 6c06153
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions documentation/content/guidebook/drizzle-orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Learn how to use Drizzle ORM with Lucia"

## MySQL

Make sure to change the table names accordingly.
Make sure to change the table names accordingly. While you can name your Drizzle fields anything you want, the underlying column names must match what's defined in the docs (e.g `user_id`).

```ts
// schema.js
Expand Down Expand Up @@ -138,7 +138,7 @@ export const auth = lucia({

We recommend using `pg` with TCP connections for Supabase and Neon.

Make sure to change the table names accordingly.
Make sure to change the table names accordingly. While you can name your Drizzle fields anything you want, the underlying column names must match what's defined in the docs (e.g `user_id`).

```ts
// schema.js
Expand Down Expand Up @@ -251,7 +251,7 @@ export const auth = lucia({

## SQLite

Make sure to change the table names accordingly.
Make sure to change the table names accordingly. While you can name your Drizzle fields anything you want, the underlying column names must match what's defined in the docs (e.g `user_id`).

```ts
// schema.js
Expand Down
5 changes: 3 additions & 2 deletions documentation/content/main/basics/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type UserSchema = {
} & Lucia.DatabaseUserAttributes;
```

In addition to the required fields shown below, you can add any additional fields to the table, in which case they should be declared in type `Lucia.DatabaseUserAttributes`. **Lucia does not support default (auto-generated) database values.**
In addition to the required fields shown below, you can add any additional fields to the table, in which case they should be declared in type `Lucia.DatabaseUserAttributes`. If you're using an database driver adapter such as `pg()`, these fields must match your database columns. Keep this in mind if you're using an ORM such as Drizzle. **Lucia does not support default (auto-generated) database values.**

```ts
declare namespace Lucia {
Expand Down Expand Up @@ -79,14 +79,15 @@ type SessionSchema = {
} & Lucia.DatabaseSessionAttributes;
```

In addition to the required fields shown below, you can add any additional fields to the table, in which case they should be declared in type `Lucia.DatabaseSessionAttributes`. **Lucia does not support default (auto-generated) database values.**
In addition to the required fields shown below, you can add any additional fields to the table, in which case they should be declared in type `Lucia.DatabaseSessionAttributes`. If you're using an database driver adapter such as `pg()`, these fields must match your database columns. Keep this in mind if you're using an ORM such as Drizzle. **Lucia does not support default (auto-generated) database values.**

```ts
declare namespace Lucia {
// ...
type DatabaseSessionAttributes = {
// required fields (i.e. id) should not be defined here
username: string;
display_name: string
};
}
```
Expand Down
2 changes: 1 addition & 1 deletion documentation/content/oauth/providers/apple.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Provider id is `apple`.

```ts
import { apple } from "@lucia-auth/oauth/providers";
import { auth } from "./auth.js";
import { auth } from "./lucia.js";

const appleAuth = apple(auth, configs);
```
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const auth = lucia({
});
`;
const code3 = `import { auth } from "./auth.js";
const code3 = `import { auth } from "./lucia.js";
const user = await auth.createUser({
// user identified with their username
Expand Down

0 comments on commit 6c06153

Please sign in to comment.