Releases: Finesse/MiniDB
Releases · Finesse/MiniDB
0.7.4
Fixed:
-
Getting an aggregate fails when the query has derived fields (defined in the select section) in the order section. Example, reproducing the error:
$database ->table('posts') ->addSelect($database->raw('likes_count + comments_count'), 'acknowledgement') ->orderBy('acknowledgement', 'desc') ->count();
A more live example:
$query = $database ->table('posts') ->addSelect($database->raw('likes_count + comments_count'), 'acknowledgement') ->orderBy('acknowledgement', 'desc'); $paginator = new Pagerfanta(new PagerfantaAdapter($query)); $pagesCount = $paginator->getNbPages();
0.7.3
0.7.2
0.7.1
Fixed:
-
The
wheremethod of aQueryobject with a custom closure resolver fails when it receives an array of criteria. Example:$query = new QueryProxy($database->table('posts')); $query->where([ ['column1', 'value1'], ['column2', 'value2'] ]);
If you extend the
Queryclass and override themakeEmptyCopymethod, changepublic makeEmptyCopytoprotected constructEmptyCopyin order to fix this bug.
0.7.0
- Added the «nulls first» and the «nulls last» sorts (the
Query::orderByNullFistandQuery::orderBuNullLastmethods respectively) - Added the explicit order sort (the
Query::inExplicitOrdermethod)
Breaking changes:
- The
applyCallbackmethod of theQueryandQueryProxyclasses is renamed toapply - The
Query::whereand theQuery::whereColumnmethod behaviour depends on the number of arguments but not the arguments values. So if you write$query->where('name', '>', $name)the SQL will always beWHERE "name" > ?even if$nameis null. Also these methods have stopped accepting the "append rule" argument.
0.6.0
Breaking changes:
Finesse\MiniDB\Exceptions\InvalidReturnValueExceptionextendsLogicException, notRuntimeException.
Fixed:
- PhpStorm thinks that the
Finesse\MiniDB\Query::applyCallbackmethod returns an instance of theFinesse\QueryScribe\Queryclass (and the same with theQueryProxyclass).
0.5.0
- Added the
Database::buildermethod which creates empty query instances. It helps to replace the used query class while extending theDatabaseclass. - Calling
$query->where('field', null)doesn't throw an error (but it is still not the same as$query->whereNull('field')). - The
QueryandQueryProxyclasses got theapplyCallbackmethod to make application a callback to a query be easy. - All the
QueryProxyexceptions are handled in theQueryProxy::handleExceptionmethod.
Fixed:
QueryProxythrows Query ScribeInvalidReturnValueExceptioninstead of MiniDBInvalidReturnValueException.
Backward incompatible:
- If a
Queryargument closure returns a wrong value,InvalidReturnValueExceptionis thrown instead ofInvalidArgumentException. - The
QueryandQueryProxyresolveClosuremethods are removed prior to theapplyCallbackmethods. - The
QueryProxy::handleBaseQueryExceptionmethod is renamed tohandleException.
0.4.0
- The
DatabaseandQueryclasses got the methodescapeLikeWildcardsto escape LIKE special characters. - The
DatabaseandQueryclasses got the methodsquoteIdentifierandquoteCompositeIdentifierto quote identifiers in raw queries. - The
addTablePrefixandaddTablePrefixToColumnmethods are available in theQuerytoo.
Backward incompatible:
- The
Query::where...methods accept string SQL logical operator names ('AND','OR') instead of theCriterion::APPEND_RULE_...constants. TheCriterion::APPEND_RULE_...constants are removed. - All the traits moved to the
Finesse\MiniDB\Partsnamespace.