- #120:
EasyStatement
now defaults toWHERE 1 = 1
instead ofWHERE 1
to ensure success with PostgreSQL. - #122: Builds on PHP 7.4 in Travis CI, installs on PHP 8.
- You can now pull the original exception (which may leak credentials via
stack trace) from a
ConstructorFailed
exception by calling the newgetRealException()
method. - Added
insertIgnore()
(Insert a row into the table, ignoring on key collisions) - Added
insertOnDuplicateKeyUpdate()
(Insert a row into the table; or if a key collision occurs, doing an update instead) - #111:
EasyStatement
: Don't fail with emptyIN()
statements
- You can now side-step credential leakage in the
Factory
class by callingFactory::fromArray([$dsn, $username, $password, $options])
instead ofFactory::create($dsn, $username, $password, $options)
.
- Our exceptions now integrate with Corner.
- Changed the behavior of several public APIs to invoke
$this->prepare()
instead of$this->pdo->prepare()
. This might seem subtle, but in actuality, it allows classes that extendEasyDB
to implement prepared statement caching.
- Fix errors when inserting booleans.
- #77: Detect when the driver is missing and throw a distinct error message to aid in debugging.
- #69: Fixed an error when using EasyDB with SQLite.
- #70: You can now use
EasyStatement
objects for the conditions instead of arrays inEasyDB::update()
andEasyDB::delete()
. (Arrays are still supported!)
- Fixed boolean handling for SQLite databases.
- #56:
EasyDB::q()
andEasyDB::row()
no longer explicitly forcePDO::FETCH_ASSOC
. Thanks @nfreader. - #57: Added
EasyDB::insertReturnId()
which wrapsinsert()
andlastInsertId()
. Important: Do not use this on PostgreSQL, as it is not reliable. UseinsertGet()
instead, as you normally would have. Reported by @duskwuff. - #58: Empty
EasyStatement
clauses no longer cause broken queries. Reported by @duskwuff. - #59: Fixed grouping/precedence issues
with
EasyStatement
subqueries. Reported by @duskwuff.
- Thanks to @SignpostMarv, you can now easily run
an entire block of code in a flat transaction:
$easyDb->tryFlatTransaction(function (EasyDB $db) { /* ... */ });
- EasyDB is now fully type-safe. This is verified by Psalm. If you're using a static analysis tool on your project that uses EasyDB, this should eliminate a lot of false positive findings.
- We now allow the
/
character to be used in SQLite identifiers.
- Fix SQLite setting UTF-8 mode.
- Added
EasyDB::buildInsertQuery
for buildingINSERT
statements without executing. - Fixed escaping of backslashes in
LIKE
statements.
- Adopt strict PSR-2 code style and add
phpcs
check.
- Added
EasyDB::escapeLikeValue()
for escaping wildcards inLIKE
condition values.
- Fix PHP version requirement to work with HHVM.
- Import
EasyStatement
from 1.x version.
- Fixed a segfault caused by attempting to clone PDO objects.
The lion's share of the version 2.0.0 release was contributed by @SignpostMarv.
- Unit testing (with >80% test coverage)
- PHP 7 support
- Added an optional argument to
safeQuery()
, which allows INSERT/UPDATE queries to return success/failure instead of an empty array. - Added optional support for separators in
escapeIdentifier()
.
- Add
EasySatement
condition builder, thanks @shadowhand
- Version 1.0.0 EasyDB official release.
- Supports PHP 5.
- Fix more issues with constructor names.
- Fix exception namespaces
- Get rid of composer version directive. Use github instead.
- Do not emulate prepared statements.
- Optimized
EasyDB::column()
thanks @Xeoncross - Added
EasyDB::insertMany()
, so it's possible to insert many rows at once using the same prepared statement.
Initial Release