Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #1255

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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