Installation¶
This guide explains how to install pGenie on your system.
Prerequisites¶
Docker¶
pGenie requires Docker to be installed and running. During code generation, it starts a temporary PostgreSQL container to analyze your SQL. Without Docker, pGenie cannot function.
- macOS / Windows: Install Docker Desktop.
- Linux: Install the Docker Engine for your distribution.
After installation, verify Docker is running:
Installing from Source¶
pGenie is written in Haskell and built with Cabal.
Prerequisites¶
-
GHC and Cabal - Install the Haskell toolchain via GHCup:
Follow the prompts to install GHC and Cabal.
Steps¶
-
Clone the repository:
-
Install the
pgnexecutable:Cabal will compile pGenie and install the
pgnbinary into~/.cabal/bin/. -
Ensure
~/.cabal/binis on yourPATH. Add the following to your shell profile (.bashrc,.zshrc, etc.): -
Verify the installation:
Platform Notes¶
Windows¶
- Ensure Docker Desktop is installed and the Docker daemon is running before invoking
pgn. - The
~/.cabal/bindirectory is typically%APPDATA%\cabal\bin; add it to yourPATHvia the System Properties dialog or your PowerShell profile.
macOS¶
- Docker Desktop for macOS must be running (the Docker icon should appear in the menu bar).
- GHCup works on both Intel and Apple Silicon Macs.
Linux¶
- Docker must be running as a daemon (
systemctl start dockerorsudo service docker start). -
Your user should be in the
dockergroup to avoid requiringsudo:
First Run¶
The very first time you run pgn generate, pGenie performs initial setup that can take 2–3 minutes:
- PostgreSQL Docker image download - pGenie pulls the PostgreSQL image it needs. This is a one-time download.
- Code generator caching - Dhall generator programs are downloaded from their URLs and their bytecode is cached locally.
You may notice pGenie appears to pause at the "Loading" stage during this first run. This is normal. Subsequent runs complete in a few seconds.