From 6c0615389d86e38e7c07c7ecbc2011f39473ab84 Mon Sep 17 00:00:00 2001 From: pilcrowOnPaper <80624252+pilcrowOnPaper@users.noreply.github.com> Date: Tue, 7 Nov 2023 00:04:47 +0900 Subject: [PATCH] Update docs (#1255) --- documentation/content/guidebook/drizzle-orm.md | 6 +++--- documentation/content/main/basics/database.md | 5 +++-- documentation/content/oauth/providers/apple.md | 2 +- documentation/src/pages/index.astro | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/documentation/content/guidebook/drizzle-orm.md b/documentation/content/guidebook/drizzle-orm.md index cd5c468e2..d76aa05d6 100644 --- a/documentation/content/guidebook/drizzle-orm.md +++ b/documentation/content/guidebook/drizzle-orm.md @@ -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 @@ -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 @@ -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 diff --git a/documentation/content/main/basics/database.md b/documentation/content/main/basics/database.md index 8f2cad195..36ffeb48e 100644 --- a/documentation/content/main/basics/database.md +++ b/documentation/content/main/basics/database.md @@ -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 { @@ -79,7 +79,7 @@ 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 { @@ -87,6 +87,7 @@ declare namespace Lucia { type DatabaseSessionAttributes = { // required fields (i.e. id) should not be defined here username: string; + display_name: string }; } ``` diff --git a/documentation/content/oauth/providers/apple.md b/documentation/content/oauth/providers/apple.md index 2fb57f8a9..a263e5a3b 100644 --- a/documentation/content/oauth/providers/apple.md +++ b/documentation/content/oauth/providers/apple.md @@ -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); ``` diff --git a/documentation/src/pages/index.astro b/documentation/src/pages/index.astro index 0ffae9db8..8a12d7a97 100644 --- a/documentation/src/pages/index.astro +++ b/documentation/src/pages/index.astro @@ -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