We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@lucia-auth/session-drizzle
Allow drizzle pg uuid types for session and user id fields instead of requiring a string
also just a note package should be @lucia-auth/adapter-drizzle
@lucia-auth/adapter-drizzle
Should allow something like this
import { pgTable, timestamp, varchar, primaryKey, uuid, index, } from "drizzle-orm/pg-core"; import { v7 as uuidv7 } from "uuid"; export const usersTable = pgTable( "users", { id: uuid("id").primaryKey().$defaultFn(uuidv7), username: varchar("username", { length: 60 }).unique().notNull(), avatar: varchar("avatar", { length: 2048 }), email: varchar("email", { length: 255 }), createdAt: timestamp("created_at").defaultNow().notNull(), lastLogin: timestamp("last_login").defaultNow().notNull(), }, (table) => { return { usernameIndex: index("username_index").on(table.username), }; }, ); export const sessionsTable = pgTable("sessions", { id: uuid("id").primaryKey().$defaultFn(uuidv7), userId: uuid("user_id") .notNull() .references(() => usersTable.id), expiresAt: timestamp("expires_at", { withTimezone: true, mode: "date", }).notNull(), });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Package
@lucia-auth/session-drizzle
Description
Allow drizzle pg uuid types for session and user id fields instead of requiring a string
Should allow something like this
The text was updated successfully, but these errors were encountered: