Skip to content

Commit 057fc5c

Browse files
committed
feat: add support for postgres bindings
1 parent 334ff9c commit 057fc5c

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/CI.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
build: pnpm build
4444
setup: |
4545
brew install autoconf automake libtool re2c bison libiconv \
46-
argon2 libzip
46+
argon2 libzip postgresql@16
4747
4848
# TODO: Do we need to care about x86_64 macOS?
4949
# NOTE: Unable to force link bison on macOS 13, which php-src requires.
@@ -53,7 +53,7 @@ jobs:
5353
build: pnpm build
5454
setup: |
5555
brew install autoconf automake libtool re2c bison libiconv \
56-
argon2 libzip
56+
argon2 libzip postgresql@16
5757
5858
#
5959
# Linux
@@ -71,7 +71,7 @@ jobs:
7171
libcurl4-openssl-dev autoconf libxml2-dev libsqlite3-dev \
7272
bison re2c libonig-dev patchelf zlib1g-dev openssh-client git \
7373
libclang-dev libreadline-dev libpng-dev libjpeg-dev libzip-dev \
74-
libsodium-dev libargon2-dev
74+
libsodium-dev libargon2-dev libpq-dev
7575
7676
# TODO: Can't use the musl container, need to build with ssh-agent access.
7777
# TODO: Fails because missing x86_64-linux-musl-gcc
@@ -161,6 +161,7 @@ jobs:
161161
export PATH="$(brew --prefix bison)/bin:$PATH"
162162
export LDFLAGS="$LDFLAGS -L$(brew --prefix bison)/lib"
163163
export CPPFLAGS="$CPPFLAGS -I$(brew --prefix bison)/include"
164+
export PKG_CONFIG_PATH="$(brew --prefix postgresql@16)/lib/pkgconfig"
164165
fi
165166
166167
cd php-src
@@ -176,6 +177,7 @@ jobs:
176177
--enable-zts \
177178
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
178179
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
180+
--with-pdo-pgsql --with-pgsql \
179181
--with-openssl --with-password-argon2 --with-sodium=shared \
180182
--with-curl \
181183
--enable-mbstring --with-mhash \
@@ -226,6 +228,7 @@ jobs:
226228
--enable-zts \
227229
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
228230
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
231+
--with-pdo-pgsql=/usr --with-pgsql=/usr \
229232
--with-openssl --with-password-argon2 --with-sodium=shared \
230233
--with-curl \
231234
--enable-mbstring --with-mhash \
@@ -303,12 +306,12 @@ jobs:
303306
target: x86_64-apple-darwin
304307
architecture: x64
305308
setup: |
306-
brew install openssl@3 argon2
309+
brew install openssl@3 argon2 postgresql@16
307310
- host: macos-15
308311
target: aarch64-apple-darwin
309312
architecture: arm64
310313
setup: |
311-
brew install openssl@3 argon2 libzip
314+
brew install openssl@3 argon2 libzip postgresql@16
312315
# - host: windows-latest
313316
# target: x86_64-pc-windows-msvc
314317
# architecture: x64
@@ -428,7 +431,7 @@ jobs:
428431
libcurl4-openssl-dev autoconf libxml2-dev libsqlite3-dev \
429432
bison re2c libonig-dev libargon2-dev libzip-dev zlib1g-dev \
430433
openssh-client libclang-dev libreadline-dev libpng-dev \
431-
libjpeg-dev libsodium-dev
434+
libjpeg-dev libsodium-dev libpq5
432435
433436
npm run test
434437

INTERNALS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Install the following tools:
88

99
```
10-
brew install autoconf automake libtool re2c bison libiconv
10+
brew install autoconf automake libtool re2c bison libiconv postgresql@16
1111
```
1212

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

3536
./buildconf
@@ -42,6 +43,7 @@ fi
4243
--enable-zts \
4344
--enable-mysqlnd --with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd \
4445
--with-pdo-sqlite=/usr --with-sqlite3=/usr \
46+
--with-pdo-pgsql --with-pgsql \
4547
--with-openssl --with-password-argon2 --with-sodium=shared \
4648
--with-curl \
4749
--enable-mbstring --with-mhash \

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ as listed below:
1919
```sh
2020
sudo apt-get update
2121
sudo apt-get install -y libssl-dev libcurl4-openssl-dev libxml2-dev \
22-
libsqlite3-dev libonig-dev re2c
22+
libsqlite3-dev libonig-dev re2c libpq5
2323
```
2424

2525
### macOS
2626

2727
```sh
28-
brew install openssl@3 curl sqlite libxml2 oniguruma
28+
brew install openssl@3 curl sqlite libxml2 oniguruma postgresql@16
2929
```
3030

3131
## Install

0 commit comments

Comments
 (0)