Skip to content

feat: add support for postgres bindings #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
build: pnpm build
setup: |
brew install autoconf automake libtool re2c bison libiconv \
argon2 libzip
argon2 libzip postgresql@16

# TODO: Do we need to care about x86_64 macOS?
# NOTE: Unable to force link bison on macOS 13, which php-src requires.
Expand All @@ -53,7 +53,7 @@ jobs:
build: pnpm build
setup: |
brew install autoconf automake libtool re2c bison libiconv \
argon2 libzip
argon2 libzip postgresql@16

#
# Linux
Expand All @@ -71,7 +71,7 @@ jobs:
libcurl4-openssl-dev autoconf libxml2-dev libsqlite3-dev \
bison re2c libonig-dev patchelf zlib1g-dev openssh-client git \
libclang-dev libreadline-dev libpng-dev libjpeg-dev libzip-dev \
libsodium-dev libargon2-dev
libsodium-dev libargon2-dev libpq-dev

# TODO: Can't use the musl container, need to build with ssh-agent access.
# TODO: Fails because missing x86_64-linux-musl-gcc
Expand Down Expand Up @@ -161,6 +161,7 @@ jobs:
export PATH="$(brew --prefix bison)/bin:$PATH"
export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib"
export CPPFLAGS="$CPPFLAGS -I$(brew --prefix bison)/include"
export PKG_CONFIG_PATH="$(brew --prefix postgresql@16)/lib/pkgconfig"
fi

cd php-src
Expand All @@ -176,6 +177,7 @@ jobs:
--enable-zts \
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
--with-pdo-pgsql --with-pgsql \
--with-openssl --with-password-argon2 --with-sodium=shared \
--with-curl \
--enable-mbstring --with-mhash \
Expand Down Expand Up @@ -226,6 +228,7 @@ jobs:
--enable-zts \
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
--with-pdo-pgsql=/usr --with-pgsql=/usr \
--with-openssl --with-password-argon2 --with-sodium=shared \
--with-curl \
--enable-mbstring --with-mhash \
Expand Down Expand Up @@ -303,12 +306,12 @@ jobs:
target: x86_64-apple-darwin
architecture: x64
setup: |
brew install openssl@3 argon2
brew install openssl@3 argon2 postgresql@16
- host: macos-15
target: aarch64-apple-darwin
architecture: arm64
setup: |
brew install openssl@3 argon2 libzip
brew install openssl@3 argon2 libzip postgresql@16
# - host: windows-latest
# target: x86_64-pc-windows-msvc
# architecture: x64
Expand Down Expand Up @@ -428,7 +431,7 @@ jobs:
libcurl4-openssl-dev autoconf libxml2-dev libsqlite3-dev \
bison re2c libonig-dev libargon2-dev libzip-dev zlib1g-dev \
openssh-client libclang-dev libreadline-dev libpng-dev \
libjpeg-dev libsodium-dev
libjpeg-dev libsodium-dev libpq5

npm run test

Expand Down
4 changes: 3 additions & 1 deletion INTERNALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Install the following tools:

```
brew install autoconf automake libtool re2c bison libiconv
brew install autoconf automake libtool re2c bison libiconv postgresql@16
```

Add the following to your `~/.bash_profile` or `~/.zshrc`:
Expand All @@ -30,6 +30,7 @@ cd php-src
if [[ "$(uname)" == "Darwin" ]]; then
export PATH="$(brew --prefix bison)/bin:$(brew --prefix libiconv)/bin:$PATH"
export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib -L$(brew --prefix libiconv)/lib -L$(brew --prefix readline)/lib"
export PKG_CONFIG_PATH="$(brew --prefix postgresql@16)/lib/pkgconfig"
fi

./buildconf
Expand All @@ -42,6 +43,7 @@ fi
--enable-zts \
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
--with-pdo-pgsql --with-pgsql \
--with-openssl --with-password-argon2 --with-sodium=shared \
--with-curl \
--enable-mbstring --with-mhash \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ as listed below:
```sh
sudo apt-get update
sudo apt-get install -y libssl-dev libcurl4-openssl-dev libxml2-dev \
libsqlite3-dev libonig-dev re2c
libsqlite3-dev libonig-dev re2c libpq5
```

### macOS

```sh
brew install openssl@3 curl sqlite libxml2 oniguruma
brew install openssl@3 curl sqlite libxml2 oniguruma postgresql@16
```

## Install
Expand Down
Loading