Skip to content

Instantly share code, notes, and snippets.

View agungsptr's full-sized avatar
🏠
Working from home

Agung Saputra agungsptr

🏠
Working from home
View GitHub Profile
@agungsptr
agungsptr / NestJsNote.md
Created July 18, 2024 08:33
NestJs Note

NestJs (Bun.js) + Prisma

Project Link: Median

This note explains something that can improve the project performance in any aspect as I know haha... :D. Or I just want to put a random note about this project for my personal learning experience.

Database

Try change Index Algorithm

First of all, actually I have been reading Prisma documentation about indexing in databases, but I found that we can't just simply put that configuration in schema.prisma so to change the index algorithm we need to touch the database itself.

I have been tried using @@index([id], name: "id_hash_idx", type: Hash) in schema.prisma, and what I get is Prisma just create new index with what I spesify before and not applied to id column.

@agungsptr
agungsptr / DockerNote.md
Last active July 18, 2024 08:28
Docker Note

Docker Note

This contain note that related to docker, for my personal use if I forget the command haha... :D

Authentication

Login

Before push image to registry we need to authenticate docker, to do that use this command

docker login -u username

# Or if you want to login using service account
@agungsptr
agungsptr / PostgreSQL-BackupAndRestore.md
Last active July 18, 2024 06:23
PostgreSQL - Backup and Restore

PostgreSQL Backup and Restore

Backup

Backup to .sql file

pg_dump -U username -d db_name -h host_name > out_filename.sql

# If using docker
docker container exec -it container_name pg_dump -U username -d db_name -h host_name > out_filename.sql