Download the PHP package jgamboa/laravel-aurora-dsql without Composer

On this page you can find all versions of the php package jgamboa/laravel-aurora-dsql. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-aurora-dsql

laravel-aurora-dsql

Laravel (12+) database driver for Amazon Aurora DSQL.

Nested transactions

Aurora DSQL does not support SAVEPOINT, so the connection reports supportsSavepoints() === false and a nested DB::transaction() runs inside the outer transaction. An exception caught inside the nested closure does not undo that closure's writes; one that reaches the outermost transaction rolls back everything (and an OCC conflict retries the outermost closure).

Installation

Moved from jgamboa/laravel-aurora-dsql (now abandoned, versions up to v0.2.2 stay installable). To switch, composer remove jgamboa/laravel-aurora-dsql && composer require multiapi/laravel-aurora-dsql. Since v0.3.0 the classes live under Multiapi\LaravelAuroraDsql; the old JGamboa\LaravelAuroraDsql names keep working as aliases until 1.0. The configuration is unchanged.

The service provider is auto-discovered. Add a connection to config/database.php:

The CA setting. The AWS connector always connects with sslmode=verify-full and takes no sslrootcert, so libpq reads PGSSLROOTCERT from the process environment. The driver sets it from sslrootcert with putenv() when it is not set, which works under PHP-FPM and the CLI but does not reach libpq inside FrankenPHP workers (Laravel Octane with FrankenPHP, or a FrankenPHP-based Lambda runtime): there the connection fails with root certificate file "…/.postgresql/root.crt" does not exist. Set PGSSLROOTCERT=system (or a CA bundle path) as a real environment variable of the process instead. Arco Cloud sends it with its managed databases.

The driver applies search_path (or schema) to the session on connect, like Laravel's pgsql driver; leave both unset to keep the role's default search_path.

On Aurora DSQL a non-admin role cannot create objects in public (permission denied for schema public, and GRANT … ON SCHEMA public fails with "feature not supported on system entity"). An app that connects with its own role therefore uses its own schema and sets DSQL_SEARCH_PATH to it. Arco Cloud sets it automatically for its managed databases.

Usage

Optimistic concurrency

DSQL uses optimistic concurrency control: a conflicting write fails with SQLSTATE 40001 (OC000/OC001), frequently at COMMIT. This package retries those conflicts for you, with exponential backoff (base 50 ms, cap 1000 ms, jitter):

Configure it per connection with 'occ_max_retries' => 3.

Unique indexes

DSQL has two kinds of unique, and the driver uses both:

The index behind a constraint cannot be dropped with DROP INDEX ("cannot drop index ... because constraint ... requires it"), and an async unique index has no constraint to drop. So dropUnique() and dropIndex() both compile to DROP INDEX, and the connection checks pg_constraint first: a unique constraint of that name (current schema) is dropped with ALTER TABLE ... DROP CONSTRAINT, anything else with DROP INDEX. Either method drops either kind, so migrations written for 0.3 keep working on tables created by either version.

Index builds during migrate

CREATE INDEX ASYNC starts a background job that takes about 10 to 13 seconds even on an empty table, while CREATE TABLE and ALTER TABLE take milliseconds. Waiting for each job in turn makes a migrate run wait for every index one after another (about 20 minutes for Arco Cloud's schema from scratch). Not waiting is not an answer: a job that finishes while a CREATE TABLE or ALTER TABLE runs fails that statement with OC001.

So during migrate (not --pretend), each dsql connection holds back the indexes the schema builder creates and builds them together. Nothing changes in the migrations.

Each connection has its own queue, and connections of other drivers are not touched.

Limits:

'index_builds' => 'per-index' turns this off: the connection waits after each index, in migration order. 'wait_for_indexes' => false turns it off too (nothing waits at all).

DSQL limitations (verified against a live cluster)

Not supported Alternative
Adding a PK / FK / UNIQUE / CHECK to an existing table Declare them in Schema::create(); on an existing table ->unique() is an async unique index
ADD COLUMN with DEFAULT, NOT NULL or a FK Add it nullable → SET DEFAULT → backfill
->change() (changing a column type), SET NOT NULL New table + copy + rename
Nested transactions (SAVEPOINT) Avoid DB::transaction() inside another one
TRUNCATE delete()
Temporary tables, triggers, plpgsql, extensions, advisory locks, sharedLock() —
Full-text search with a language config Only simple is available
CREATE DATABASE One cluster per database

Supported: lockForUpdate, upsert (needs a unique index), JSON/JSONB, CTEs, window functions, views, sequences, language sql functions.

Prepared statements

Every dsql connection uses emulated prepares (PDO::ATTR_EMULATE_PREPARES, since v0.3.1): pdo_pgsql built against libpq 17+ closes server-side prepared statements with a protocol message that DSQL rejects, which aborted the transaction after its first statement (SQLSTATE 25P02). Bindings are escaped by PDO and booleans are sent as true/false; nothing changes in application code.

Operational notes: connections last at most 60 minutes (long-running processes must reconnect); the IAM token is signed locally (no network call).

Testing

License

MIT


All versions of laravel-aurora-dsql with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
awslabs/aurora-dsql-pdo-pgsql Version ^0.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jgamboa/laravel-aurora-dsql contains the following files

Loading the files please wait ...