https://github.com/kauefraga/learning-postgres
🐘 Trying out SQL using postgres "bare metal" (without orm)
https://github.com/kauefraga/learning-postgres
migrations postgres postgresql sql
Last synced: 2 months ago
JSON representation
🐘 Trying out SQL using postgres "bare metal" (without orm)
- Host: GitHub
- URL: https://github.com/kauefraga/learning-postgres
- Owner: kauefraga
- License: mit
- Created: 2022-10-02T02:00:22.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-08T20:28:21.000Z (over 3 years ago)
- Last Synced: 2025-03-21T14:09:20.789Z (over 1 year ago)
- Topics: migrations, postgres, postgresql, sql
- Language: TypeScript
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Learning Postgres
🐘 Trying out SQL using Postgres without orm 🐘
## 📝 Table of contents
- What do you need to run it
- [nodejs](https://nodejs.org/en) (prefer lts version)
- [pnpm](https://pnpm.io)
- [docker](https://www.docker.com)
- How to download
- How to set up Postgres (with docker)
## ⬇️ How to download and run
```bash
git clone https://github.com/kauefraga/learning-postgres.git
cd learning-postgres
npm install
npm run build
npm run start
# if you want to develop
npm run dev
```
Or downloading with yarn? `yarn && yarn build && yarn start`
Sincerely, i prefer pnpm so: `pnpm i && pnpm build && pnpm start`
## 🐳 How to set up Postgres (docker image -> bitnami/postgres)
```sh
# if you get an error try sudo mode
docker run --name postgresql bitnami/postgresql:latest
docker-compose up -d
```
source: https://hub.docker.com/r/bitnami/postgresql
## 💻 Technologies
- 🐳 [Docker](https://www.docker.com)
> Use virtualization/containerize to turn your "work on my machine" into "our machine"
- 🤫 [Dotenv](https://npmjs.com/package/dotenv)
> We must hide our secret keys, with dotenv we can load env variables into `process.env` more easily
- 💄 Code ruling with [Eslint](https://eslint.org)
- https://www.npmjs.com/package/eslint-config-airbnb-base
- https://www.npmjs.com/package/eslint-config-airbnb-typescript
- 🐘 Database [Postgres](https://www.npmjs.com/package/postgres)
> PostgreSQL is a relational database. It is the driver implementation for nodejs
- 👀 Logging with [Winston](https://www.npmjs.com/package/winston)
> Winston is fully featured logger for NodeJS applications
- 🧑💻 Developed on [Typescript](https://typescriptlang.org) + [TS-Node-Dev](https://npmjs.com/package/ts-node-dev)
> Improve dev experience by adding type safety
## 🗃️ Project tree view
```bash
.
├─ src
│ ├─ infra
│ ├─ migrations
│ ├─ db.ts
│ ├─ logger.ts
│ ├─ run-migrations.ts
│ ├─ main.ts
│ ├─ query.sql
├─ .eslintrc.json
├─ .env
├─ docker-compose.yaml
└─ tsconfig.json
```
## 📝 License
This project is licensed under the MIT License - See the [LICENSE](https://github.com/kauefraga/learning-postgres/blob/main/LICENSE) for more information.
---