-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.text
executable file
·47 lines (23 loc) · 891 Bytes
/
command.text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
docker pull postgres:12-alpine
docker rm postgres12
docker images = show all images
docker run --name postgres12 -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=secret -d postgres:12-alpine
docker ps
docker ps -a
docker exec -it postgres12 psql -U root
docker start postgres12
docker logs postgres12
docker stop postgres12
docker exec =it postgres12 /bin/sh
docker exec -it postgres12 createdb --username=root --owner=root simple_bank
docker exec -it postgres12 psql -U root simple_bank
POSTGRESQL COMMAND
createdb --username=root --owner=root simple_bank
psql simple_bank
MIGRATE COMMAND
migrate create -ext sql -dir db/migration -seq init_schema
migrate --path db/migration -database "postgresql://root:secret@localhost:5432/simple_bank?sslmode=disable" -verbose up
SQL COMPAILER
go install github.com/kyleconroy/sqlc/cmd/sqlc@latest
sqlc init
sqlc generate