Releases: Nemo64/dbal-rds-data
Releases · Nemo64/dbal-rds-data
php 8 support
improve numeric parameter emulation
It could happen that moderatly large queries (7kb+) with emulated numeric parameters fail because of a regex issue. I could improve the expression so that multiple megabytes of query now work flawlessly.
better connection emulation and more options
- You can establish a connection without selecting a database.
This is useful when you want to create the database using this api (eg with thedoctrine:database:create
command).
It is also now possible to switch databases usinguse dbname;
which won't result in an actual query but will internally set the database name in the connection instance.$driver->getDatabase($connection)
will also correctly report the database in that case. - You can now make any query block until the database is available if it was paused.
There are 2 new options for that:pauseRetries
andpauseRetryDelay
. You can read more about them in the readme.
I'll continue to default to an error instead of blocking as waiting for a minute is usually not a good idea. Lambda events will automatically retry after a minute (using exponential backoff) so you normally don't have to worry about it and interactive page loads will always feel broken if the database is paused so you'll need a better handling in that case. - I removed the direct dependency on guzzle by setting options though the aws-sdk.
You still need guzzle, it's just not my dependency anymore. There is an experimental branch which uses async-aws but that sdk may need some additional testing work for which I'm currently not motivated and don't have the time.
small change in binary handling
- remove the packaging of binary data into a resource. This is already done by dbal if the driver does not do it. However, the pdo_mysql and mysqli driver also only return a binary string so it is more consistent if you use native queries with binary data.
small bugfix introduced though cleanup
There was a new bug introduced though separating the statement and the result.
- fetch mode can now be set before the statement is executed and is retained after the statement is executed.
further refinement and testing
more test and stabilization
The main goal of this release is to stabilize and test everything.
I decided to drop the beta suffix because the core functionality should work and is mostly tested.
There are still todos and missing implementations in some places but in obscure places like when you try to iterate a result backwards.
- There are now a lot more test cases (see GitHub Actions).
- Use phpunit ^7.5 so tests can run on php 7.1
- Some api stabilization by using return types, even though dbal doesn't use them yet
- fix issue where streams created by binaries weren't rewinded before being exposed
- improve the quote implementation to avoid possible multi byte attacks. Please take a look at the
Nemo64\DbalRdsData\AbstractConnection::quote
implementation and try to find situations in which this breaks and tell me. - the "?" placeholder in sql queries won't be replaced within literal strings now.
- Improve error handling by parsing the error message to add error codes. This allows dbal to map them to correct specific exceptions like
Doctrine\DBAL\Exception\TableNotFoundException
andDoctrine\DBAL\Exception\SyntaxErrorException
. - If an Aurora Serverless is paused, then the "Communications link failure" will be mapped to error
6000
and converted to anDoctrine\DBAL\Exception\ConnectionException
so it can easily be handled.
add a timeout to guzzle
- there is now a timeout on http requests to prevent indefinite requests.
first release
This is the first release where I extracted this library out of another project.