Skip to content

Commit 4a229b1

Browse files
committed
Add Hono-Drizzle-Postgres todo app example
Signed-off-by: AYUSH KUMAR GUPTA <ayushkumargupta2908@gmail.com>
1 parent f63a20e commit 4a229b1

File tree

21 files changed

+3152
-0
lines changed

21 files changed

+3152
-0
lines changed

hono-drizzle-postgres/.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# dev
2+
.yarn/
3+
!.yarn/releases
4+
.vscode/*
5+
!.vscode/launch.json
6+
!.vscode/*.code-snippets
7+
.idea/workspace.xml
8+
.idea/usage.statistics.xml
9+
.idea/shelf
10+
11+
# deps
12+
node_modules/
13+
14+
# env
15+
.env
16+
.env.production
17+
18+
# logs
19+
logs/
20+
*.log
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
24+
pnpm-debug.log*
25+
lerna-debug.log*
26+
27+
# misc
28+
.DS_Store

hono-drizzle-postgres/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
```
2+
npm install
3+
npm run dev
4+
```
5+
6+
```
7+
open http://localhost:3000
8+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { config } from 'dotenv';
2+
import 'dotenv/config';
3+
import { defineConfig } from 'drizzle-kit';
4+
5+
6+
config(
7+
{
8+
path: './.env',
9+
}
10+
)
11+
12+
export default defineConfig({
13+
schema: './src/drizzle/schema.ts',
14+
out: './src/drizzle/migrations',
15+
dialect: 'postgresql',
16+
dbCredentials: {
17+
url: process.env.DATABASE_URL!,
18+
},
19+
verbose: true,
20+
strict: true,
21+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE TABLE "users" (
2+
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "users_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
3+
"name" varchar(255) NOT NULL,
4+
"password" varchar(255) NOT NULL,
5+
"email" varchar(255) NOT NULL,
6+
CONSTRAINT "users_email_unique" UNIQUE("email")
7+
);
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"id": "930b20b0-4719-4ad1-861e-c7509e295b1a",
3+
"prevId": "00000000-0000-0000-0000-000000000000",
4+
"version": "7",
5+
"dialect": "postgresql",
6+
"tables": {
7+
"public.users": {
8+
"name": "users",
9+
"schema": "",
10+
"columns": {
11+
"id": {
12+
"name": "id",
13+
"type": "integer",
14+
"primaryKey": true,
15+
"notNull": true,
16+
"identity": {
17+
"type": "always",
18+
"name": "users_id_seq",
19+
"schema": "public",
20+
"increment": "1",
21+
"startWith": "1",
22+
"minValue": "1",
23+
"maxValue": "2147483647",
24+
"cache": "1",
25+
"cycle": false
26+
}
27+
},
28+
"name": {
29+
"name": "name",
30+
"type": "varchar(255)",
31+
"primaryKey": false,
32+
"notNull": true
33+
},
34+
"password": {
35+
"name": "password",
36+
"type": "varchar(255)",
37+
"primaryKey": false,
38+
"notNull": true
39+
},
40+
"email": {
41+
"name": "email",
42+
"type": "varchar(255)",
43+
"primaryKey": false,
44+
"notNull": true
45+
}
46+
},
47+
"indexes": {},
48+
"foreignKeys": {},
49+
"compositePrimaryKeys": {},
50+
"uniqueConstraints": {
51+
"users_email_unique": {
52+
"name": "users_email_unique",
53+
"nullsNotDistinct": false,
54+
"columns": [
55+
"email"
56+
]
57+
}
58+
},
59+
"policies": {},
60+
"checkConstraints": {},
61+
"isRLSEnabled": false
62+
}
63+
},
64+
"enums": {},
65+
"schemas": {},
66+
"sequences": {},
67+
"roles": {},
68+
"policies": {},
69+
"views": {},
70+
"_meta": {
71+
"columns": {},
72+
"schemas": {},
73+
"tables": {}
74+
}
75+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "7",
3+
"dialect": "postgresql",
4+
"entries": [
5+
{
6+
"idx": 0,
7+
"version": "7",
8+
"when": 1738220820408,
9+
"tag": "0000_wise_sunspot",
10+
"breakpoints": true
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)