Releases: parable-php/query
Parable Query 1.0.1
Parable Query 1.0.0
It's time! Finally a 1.0.0 release, locking the interface in place for at least a while.
Changes
- Namespace
Translatorhas been renamed toTranslatorsfor consistency. - Namespace
Conditionhas been renamed toConditionsfor consistency.
Parable Query 0.5.0
0.5.0
- Added static analysis through psalm.
- Renamed
ExceptiontoQueryExceptionfor clarity. - General php8 code style upgrades.
Parable Query 0.4.0
0.4.0
Changes
- Dropped support for php7, php8 only from now on.
Parable Query 0.3.3
0.3.2 & 0.3.3
- Removed unnecessary check whether an update query had an alias.
- Fixed bug where values that implemented
__toString()were not correctly identified as such, and would remain unquoted. - Fixed test assert value to be more specific.
Parable Query 0.3.1
0.3.1
Bugfixes
buildInsertValues()used the wrong glue to implode value sets.
Parable Query 0.3.0
0.3.0
Changes
- The
SupportsForceIndexTraittraitQuery::forceIndex(string $key)andQuery::getForceIndex(): ?stringhave been added, allowing you to force a specific index. UsePRIMARY_KEY_INDEX_VALUEin place of the actual primary key to force the primary key as an index. Query::delete()andQuery::update()no longer accept aliases since they caused issues.AbstractCondition::VALUE_TYPE_VALUEandAbstractCondition::VALUE_TYPE_KEYhave been removed.Query::ORDER_ASCandQuery::ORDER_DESChave been removed.Query::VALID_TYPEShas been removed, as it was unused.- All string values of
ANDandORhave been replaced withAbstractCondition::TYPE_ANDandAbstractCondition::TYPE_OR. ORDER_ASCandORDER_DESChave been changed fromintvalues to their correspondingstringvaluesASCandDESC.OrderBy::getDirectionAsString()has turned intoOrderBy::getDirection().- The
BuilderTestnow also attempts to run the queries. Adding this step made some issues clear, which are now all fixed.
Parable Query 0.2.1
0.2.1
Changes
hasValueSets()was removed but proves useful enough to put back in.Orderrenamed toOrderBy, can no longer be created without keys being passed.
Parable Query 0.2.0
0.2.0
Changes
-
Query::orderBy()now takes anOrderobject, rather than string values. Example:->orderBy(Order::asc('id', 'username')), which will parse toORDER BY id ASC, username ASC. Use::descfor descending. You can call it multiple times, so you can do one keyASC, one keyDESC, and then anotherASCif you want.NOTE: Adding a key more than once is possible, but not if they are of different directions.
-
Most places where single-type values were being passed into a method as an array, it now expects the values to be passed as multiple parameters. These methods expect multiple parameters rather than an array:
Order::asc(...$keys)Order::desc(...$keys)Query::setColumns(...$columns)Query::groupBy(...$keys)
-
Translators are now type-hinted as
TranslatorInterfaceand all methods onAbstractTranslatorhave been made protected. This makes it easier to see what functionality is necessary to expose to the outside. -
Queryhas gained some quality of life methods:hasWhereConditions(): bool,hasGroupBy(): bool,hasOrderBy(): boolandcountValueSets(): int. -
Query::createCleanClone()has been added, which will return a copy of the query you called it on, with no further configuration whatsoever being retained.
Parable Query 0.1.4
0.1.4
Bugfixes
- Make sure we never try to
quote()a non-string value by string-casting before we hand it over toPDO.