This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Memasukkan data ke database | |
INSERT INTO person (name, age, city) VALUES ("Dadang", 24, "Bandung") | |
INSERT INTO person (name, age, city) VALUES ("Siti", 31, "Jakarta") | |
-- Ambil data dari database | |
SELECT name, age FROM person ORDER BY name; | |
/* | |
---------------------- | |
| name | age | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir $HOME/.postgres-data | |
cd $HOME/.postgres-data | |
docker kill postgres pgadmin4 | |
docker rm postgres pgadmin4 | |
docker volume create --driver local --name=pgvolume | |
docker volume create --driver local --name=pga4volume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd $HOME/.postgres-data | |
docker start postgres pgadmin4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
docker kill postgres pgadmin4 | |
run-postgres-container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Di Golang jika menulis seperti ini. Ini bisa disa dijadikan bahan dokumentasi | |
dengan menjalankan command seperti | |
godoc -http=:6060 | |
Pastikan command itu dijalankan dimana file ini berada. | |
Lalu buka browser dan pergi ke `localhost:6060` untuk melihat dokumentasi tentang | |
program ini. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
postgres: | |
image: postgres:latest | |
ports: | |
- "5432:5432" | |
networks: | |
- pg-network | |
volumes: | |
- "pgvolume:/" |