PHPackages                             awslabs/aurora-dsql-pdo-pgsql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. awslabs/aurora-dsql-pdo-pgsql

ActiveLibrary

awslabs/aurora-dsql-pdo-pgsql
=============================

Aurora DSQL connector for PDO\_PGSQL

v0.1.1(1mo ago)122↑1263.6%Apache-2.0PHPPHP &gt;=8.2CI passing

Since Apr 9Pushed 1mo agoCompare

[ Source](https://github.com/awslabs/aurora-dsql-php-pdo-pgsql)[ Packagist](https://packagist.org/packages/awslabs/aurora-dsql-pdo-pgsql)[ Docs](https://github.com/awslabs/aurora-dsql-connectors/tree/main/php/pdo_pgsql)[ RSS](/packages/awslabs-aurora-dsql-pdo-pgsql/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Aurora DSQL PHP PDO\_PGSQL Connector
====================================

[](#aurora-dsql-php-pdo_pgsql-connector)

Overview
--------

[](#overview)

A PHP connector for Amazon Aurora DSQL that wraps [PDO\_PGSQL](https://www.php.net/manual/en/ref.pdo-pgsql.php) with automatic IAM authentication, SSL enforcement (`sslmode=verify-full`), and built-in OCC retry with exponential backoff. The connector handles token generation and connection configuration so you can focus on your application logic.

Features
--------

[](#features)

- Automatic IAM token generation via AWS SDK for PHP
- SSL always enabled with `verify-full` mode and direct TLS negotiation (libpq 17+)
- Flexible host configuration (full endpoint or cluster ID)
- Region auto-detection from endpoint hostname
- Support for AWS profiles and custom credentials providers
- OCC retry with exponential backoff and jitter
- PSR-3 compatible logging for retry diagnostics
- Connection string (`postgres://`) parsing support
- PDO attribute overrides for full control over connection behavior

Prerequisites
-------------

[](#prerequisites)

- PHP 8.2 or later
- `ext-pdo_pgsql` extension
- AWS credentials configured (see [Credentials Resolution](#credentials-resolution) below)
- An Aurora DSQL cluster

For information about creating an Aurora DSQL cluster, see the [Getting started with Aurora DSQL](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/getting-started.html) guide.

### Credentials Resolution

[](#credentials-resolution)

The connector uses the [AWS SDK for PHP default credential chain](https://docs.aws.amazon.com/sdkref/latest/guide/standardized-credentials.html), which resolves credentials in the following order:

1. **Environment variables** (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and optionally `AWS_SESSION_TOKEN`)
2. **Shared credentials file** (`~/.aws/credentials`) with optional profile via `AWS_PROFILE` or `profile` config
3. **Shared config file** (`~/.aws/config`)
4. **IAM role for Amazon EC2/ECS/Lambda** (instance metadata or task role)

The first source that provides valid credentials is used. You can override this by specifying `profile` for a specific AWS profile or `credentialsProvider` for complete control over credential resolution.

Installation
------------

[](#installation)

```
composer require awslabs/aurora-dsql-pdo-pgsql
```

Quick Start
-----------

[](#quick-start)

```
