Go SQL builders:
- https://github.com/doug-martin/goqu?utm_campaign=awesomego&utm_medium=referral&utm_source=awesomego
- https://github.com/huandu/go-sqlbuilder

Starting the application
1. download external libraries
go mod download
2. Compile and run application
go run .
(3. Build  application as binary)
go build -o myapp

Environment variables to configure the application
- XOXO_WEBSERVER_ADDR
- XOXO_WEBSERVER_DB_HOST
- XOXO_WEBSERVER_DB_PORT
- XOXO_WEBSERVER_DB_USER
- XOXO_WEBSERVER_DB_PASSWORD 
- XOXO_WEBSERVER_DB_NAME

Docker compose commands:
docker compose up --build
docker compose down










Scratch notes:
Docker commands:
docker build -t pg -f pg.Dockerfile .
docker run -d -p 5432:5432 --name pg_container pg

docker build -t test_img -f Dockerfile .
docker run -d --network bridge -p 3333:3333 --name test_container test_img

docker build -t flat_img -f Dockerfile .
docker run -d -p 3333:3333 --name flat_container flat_img

docker build -t w_img -f Dockerfile .
docker run -d -p 3333:3333 --name w_container w_img

docker compose up --build
docker compose down

Docker compose
- secrets: https://docs.docker.com/compose/use-secrets/
- networking: https://docs.docker.com/network/
- https://stackoverflow.com/questions/36884991/how-to-rebuild-docker-container-in-docker-compose-yml

Go commands:
go get github.com/huandu/go-sqlbuilder@latest

Go SQL builders:
- https://github.com/doug-martin/goqu?utm_campaign=awesomego&utm_medium=referral&utm_source=awesomego
- https://github.com/huandu/go-sqlbuilder

12factor:
https://12factor.net/

Check used ports
netstat -a -n -p tcp -o | grep ":3333"

0.0.0.0 vs localhost:
127.0.0.1: This is known as the loopback address. It's used to establish an IP connection to the same machine or computer being used by the end-user. When a device sends packets to this address, they are routed back to the same device, essentially allowing communication with itself. It's commonly used for testing network applications or troubleshooting.

0.0.0.0: This is a special reserved address often referred to as an unspecified or wildcard address. It is typically used in routing tables or network configuration settings to represent "any" address. For example, if a server is configured to listen on 0.0.0.0, it means it will accept connections from any available network interface on the system. It's commonly used to bind a service to all available network interfaces on a device.

docker exec -it 1e0b6256e404 /bin/bash 
psql -d testdb -U testuser -W

SELECT column_name, data_type, character_maximum_length, is_nullable FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'job_log';

SELECT pg_attribute.attname AS column_name FROM pg_index, pg_class, pg_attribute WHERE pg_class.oid = 'job_log'::regclass AND indrelid = pg_class.oid AND pg_attribute.attrelid = pg_class.oid AND pg_attribute.attnum = any(pg_index.indkey) AND indisprimary;

select * from job_log;
select * from quote;
