Skip to content

Releases: Finesse/MiniDB

0.7.4

15 Feb 09:20
Compare
Choose a tag to compare

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

19 Jan 04:27
Compare
Choose a tag to compare

Fixed:

  • A query with an IN clause with no values (e.g. ->whereIn('type', [])) causes a database error in MySQL

0.7.2

22 Dec 12:37
Compare
Choose a tag to compare
  • Added a join support
  • Added the addTablesToColumnNames helper query method

0.7.1

08 Dec 06:54
Compare
Choose a tag to compare

Fixed:

  • The where method of a Query object 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 Query class and override the makeEmptyCopy method, change public makeEmptyCopy to protected constructEmptyCopy in order to fix this bug.

0.7.0

13 Nov 03:51
Compare
Choose a tag to compare
  • Added the «nulls first» and the «nulls last» sorts (the Query::orderByNullFist and Query::orderBuNullLast methods respectively)
  • Added the explicit order sort (the Query::inExplicitOrder method)

Breaking changes:

  • The applyCallback method of the Query and QueryProxy classes is renamed to apply
  • The Query::where and the Query::whereColumn method behaviour depends on the number of arguments but not the arguments values. So if you write $query->where('name', '>', $name) the SQL will always be WHERE "name" > ? even if $name is null. Also these methods have stopped accepting the "append rule" argument.

0.6.0

18 Mar 08:18
Compare
Choose a tag to compare

Breaking changes:

  • Finesse\MiniDB\Exceptions\InvalidReturnValueException extends LogicException, not RuntimeException.

Fixed:

  • PhpStorm thinks that the Finesse\MiniDB\Query::applyCallback method returns an instance of the Finesse\QueryScribe\Query class (and the same with the QueryProxy class).

0.5.0

28 Nov 06:11
Compare
Choose a tag to compare
  • Added the Database::builder method which creates empty query instances. It helps to replace the used query class while extending the Database class.
  • Calling $query->where('field', null) doesn't throw an error (but it is still not the same as $query->whereNull('field')).
  • The Query and QueryProxy classes got the applyCallback method to make application a callback to a query be easy.
  • All the QueryProxy exceptions are handled in the QueryProxy::handleException method.

Fixed:

  • QueryProxy throws Query Scribe InvalidReturnValueException instead of MiniDB InvalidReturnValueException.

Backward incompatible:

  • If a Query argument closure returns a wrong value, InvalidReturnValueException is thrown instead of InvalidArgumentException.
  • The Query and QueryProxy resolveClosure methods are removed prior to the applyCallback methods.
  • The QueryProxy::handleBaseQueryException method is renamed to handleException.

0.4.0

12 Nov 06:38
Compare
Choose a tag to compare
  • The Database and Query classes got the method escapeLikeWildcards to escape LIKE special characters.
  • The Database and Query classes got the methods quoteIdentifier and quoteCompositeIdentifier to quote identifiers in raw queries.
  • The addTablePrefix and addTablePrefixToColumn methods are available in the Query too.

Backward incompatible:

  • The Query::where... methods accept string SQL logical operator names ('AND', 'OR') instead of the Criterion::APPEND_RULE_... constants. The Criterion::APPEND_RULE_... constants are removed.
  • All the traits moved to the Finesse\MiniDB\Parts namespace.

0.3.1

11 Nov 12:18
Compare
Choose a tag to compare
  • Added the statements method for executing multiple statements in a single SQL query.
  • Added the import statement for executing statements from a SQL file.

0.3.0

09 Nov 03:09
Compare
Choose a tag to compare
  • Added the Query::getTableIdentifier method.

Backward incompatible:

  • The Query::orWhere... methods don't accept the $not argument anymore.