@@ -18,13 +18,65 @@ brew install go-task
1818
1919# Linux
2020sh -c " $( curl --location https://taskfile.dev/install.sh) " -- -d -b /usr/local/bin
21+
22+ # Windows (PowerShell - run as Administrator)
23+ # Using Chocolatey
24+ choco install go-task
25+
26+ # Or using Scoop
27+ scoop install task
28+
29+ # Or download binary from https://github.com/go-task/task/releases
30+ # Extract and add to PATH
2131```
2232
2333** Note** : Tasks run in silent mode by default for cleaner output. Use ` task -v <task-name> ` to see verbose output when debugging.
2434
25- ### 2. Available Variables
35+ ### 2. Set Environment Variables (Optional but Recommended)
36+
37+ Setting these environment variables simplifies your workflow:
38+
39+ ``` bash
40+ # Set in your shell (add to ~/.bashrc, ~/.zshrc, or use direnv)
41+ export PG_MAJOR=18 # Your preferred PostgreSQL version
42+ export COMPOSE_PROJECT_NAME=pg_lake # Compose project name
43+
44+ # Or use different project names to run multiple versions simultaneously
45+ export COMPOSE_PROJECT_NAME=pg_lake_pg17 # For PG 17 instance
46+ export COMPOSE_PROJECT_NAME=pg_lake_pg16 # For PG 16 instance
47+ ```
48+
49+ ** Benefits:**
50+
51+ - ** No need to specify ` PG_MAJOR ` with every command** - ` task compose:up ` instead of ` task compose:up PG_MAJOR=17 `
52+ - ** Run multiple versions simultaneously** - Use different ` COMPOSE_PROJECT_NAME ` for each version to avoid conflicts
53+ - ** Consistent development environment** - All tools use the same PostgreSQL version
2654
27- You can customize builds using these variables:
55+ ** Using direnv (recommended):**
56+
57+ ``` bash
58+ # Install direnv (if not already installed)
59+ brew install direnv # macOS
60+ apt install direnv # Ubuntu/Debian
61+
62+ # Enable direnv in your shell (add to ~/.bashrc or ~/.zshrc)
63+ eval " $( direnv hook bash) " # For bash
64+ eval " $( direnv hook zsh) " # For zsh
65+
66+ # Create .envrc in the docker directory
67+ cd docker
68+ cat > .envrc << 'EOF '
69+ export PG_MAJOR=17
70+ export COMPOSE_PROJECT_NAME=pg_lake_pg17
71+ EOF
72+
73+ # Allow direnv to load the file
74+ direnv allow
75+ ```
76+
77+ ### 3. Available Build Variables
78+
79+ You can customize builds using these variables (can be set as environment variables or passed to Task):
2880
2981| Variable | Default | Description | Example |
3082| ----------| ---------| -------------| ---------|
@@ -33,12 +85,13 @@ You can customize builds using these variables:
3385| ` BASE_IMAGE_TAG ` | ` 9 ` | Base OS version tag | ` BASE_IMAGE_TAG=12 ` |
3486| ` VERSION ` | ` latest ` | Image version tag (for registry) | ` VERSION=v1.0.0 ` |
3587
36- ### 3 . Build and Start Everything
88+ ### 4 . Build and Start Everything
3789
3890``` bash
3991cd docker
4092
4193# Build images and start all services (default: PostgreSQL 18)
94+ # If PG_MAJOR is set as env var, it will use that version automatically
4295task compose:up
4396
4497# Build images and start all services for PostgreSQL 17
@@ -61,12 +114,18 @@ This single command will:
61114- Start pgduck_server (DuckDB integration)
62115- Start LocalStack (S3-compatible storage)
63116
64- ### 4 . Connect and Test
117+ ### 5 . Connect and Test
65118
66119``` bash
67120# Connect to PostgreSQL from your host
68121psql -h localhost -p 5432 -U postgres
69122
123+ # Verify PostgreSQL version (should match your PG_MAJOR)
124+ SHOW server_version;
125+ # Example output for PG 18: PostgreSQL 18.0 on ...
126+ # Example output for PG 17: PostgreSQL 17.6 on ...
127+ # Example output for PG 16: PostgreSQL 16.10 on ...
128+
70129# Create a test Iceberg table
71130CREATE TABLE test(id int, name text) USING iceberg;
72131
0 commit comments