drizzle setup
This commit is contained in:
1 parent
8808daead3
commit
9942a11c0d
3 files changed
+34
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import "dotenv/config";
|
||||
import { drizzle } from "drizzle-orm/node-postgres";
|
||||
|
||||
// You can specify any property from the node-postgres connection options
|
||||
const db = drizzle({
|
||||
connection: {
|
||||
connectionString: process.env.DATABASE_URL!,
|
||||
ssl: true,
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
import { integer, pgTable, varchar } from "drizzle-orm/pg-core";
|
||||
|
||||
export const usersTable = pgTable("users", {
|
||||
id: integer().primaryKey().generatedAlwaysAsIdentity(),
|
||||
name: varchar({ length: 255 }).notNull(),
|
||||
email: varchar({ length: 255 }).notNull().unique(),
|
||||
});
|
||||
Reference in new issue
Block a user