feat: add Drizzle ORM support and update README with environment setup and migration scripts
This commit is contained in:
@@ -1,15 +1,47 @@
|
||||
# backend
|
||||
|
||||
To install dependencies:
|
||||
## Install
|
||||
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
To run:
|
||||
## Environment
|
||||
|
||||
Create a `.env` file:
|
||||
|
||||
```bash
|
||||
bun run index.ts
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
This project was created using `bun init` in bun v1.3.5. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
||||
Set:
|
||||
|
||||
```bash
|
||||
DATABASE_URL=postgres://username:password@localhost:5432/database_name
|
||||
```
|
||||
|
||||
## Run app
|
||||
|
||||
```bash
|
||||
bun run dev
|
||||
```
|
||||
|
||||
## Drizzle ORM
|
||||
|
||||
Generate migrations:
|
||||
|
||||
```bash
|
||||
bun run db:generate
|
||||
```
|
||||
|
||||
Apply migrations:
|
||||
|
||||
```bash
|
||||
bun run db:migrate
|
||||
```
|
||||
|
||||
Open Drizzle Studio:
|
||||
|
||||
```bash
|
||||
bun run db:studio
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user