An open API service indexing awesome lists of open source software.

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)

Awesome Lists containing this project

README

          

Learning Postgres


GitHub top language
Repository size

GitHub last commit

GitHub LICENSE

🐘 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.

---


Built with love
Powered by coffee