-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
My table:
export const role = pgEnum("role", ["owner", "admin", "user", "viewer"]);
export const users = pgTable("users", {
...id,
email: varchar("email", { length: 255 }).notNull(),
name: varchar("name", { length: 255 }),
workspaceID: char("workspace_id", { length: 26 + 4 })
.references(() => workspaces.id)
.notNull(),
role: role("role").default("user").notNull(),
lastSeen: timestamp("last_seen"),
}, table => [uniqueIndex("user_email_workspaceID_idx").on(table.email, table.workspaceID)]);
typeof users.$inferSelect equals
{
role: "owner" | "admin" | "user" | "viewer";
id: string;
name: string | null;
email: string;
workspaceID: string;
lastSeen: Date | null;
}
but Row<typeof schema.tables.users>
equals
{
readonly id: string;
readonly email: string;
readonly name: string | null;
readonly workspaceID: string;
readonly role: "owner" | "admin" | "user" | "viewer" | null;
readonly lastSeen: number | null;
}
Metadata
Metadata
Assignees
Labels
No labels