All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- Support for PHP 8
- Bug in
midfunction
nopfunction (no operation) towhereconditions
- SQLite compatibility issue
- Better support for expressions in column expressions and aggregate functions
- Support for expressions in the following clauses:
WHERE,HAVING,GROUP BY,ORDER BY,JOINandON - Support for aliased expressions in
SELECTstatement CROSS JOINsupport inOpis\Database\SQL\BaseStatement::crossJoin(there is noONclause)- Static method
Opis\Database\SQL\Expression::fromClosure
HAVINGstatements not working- Array of column expressions not working
- Dependency to PDO extension in
composer.jsonfile
- Fixed a bug related to boolean values
- Support for PHP 5.x
- ORM - see opis/orm library
In this major release many classes were refactored or entirely removed, in order to improve the library.
- Bugfix
- Fixed a bug related to PHP 7
- Bugfix
- Added
objectcasting type
- Rollback.
Opis\Database\Connection::countis no longer deprecated and is used again.
- Method
Opis\Database\Connection::countis now deprecated andOpis\Database\Connection::commandmethod is used instead.
- Fixed a bug in
Opis\Database\Model::__setmethod
- Added
throwExceptionsflag onOpis\Database\Modelclass
- Changed exception message in
Opis\Database\Model::__get
- Fixed a bug in
Opis\Database\Model::__setmethod
- Fixed a bug in
Opis\Database\ORM\BaseQuerythat prevented proper using of grouped conditions
- Added support for soft deletes
Opis\Database\Model::softDelete,Opis\Database\Model::supportsSoftDeletes,Opis\Database\ORM\Query::softDelete,Opis\Database\ORM\Query::restore,Opis\Database\ORM\BaseQuery::withSoftDeleted,Opis\Database\ORM\BaseQuery::onlySoftDeletedmethods were added.Opis\Database\Model::destroyandOpis\Database\Model::softDestroymethods were added- The following methods were added to
Opis\Database\ORM\Relationclass:column,count,sum,avg,min,max,update,restore,deleteandsoftDelete - Added support for timestamps
- Added
timestampsandsoftDeletemethods toOpis\Database\Schema\CreateTable - Added
updateandupdateAllmethods toOpis\Database\Modelclass
- Now you can count, update, delete, soft delete and restore related models
Opis\Database\Model::getDateFormatmethod is now public- The
Opis\Database\Model::assignmethod now returns the current model instance
- Fixed a bug in
Opis\Database\Model::__setmethod
- Added
isNewRecordproperty toOpis\Database\Modelclass in order to fix a bug that might occur when using custom values for primary key.
- The
__set,saveanddeletemethods were updated to use the newly addedisNewRecordproperty.
- Added
Opis\Database\Schema\BaseColumn::lengthmethod - Added
Opis\Database\Schema\Compiler\SQLServer::handleTypeDecimalmethod
- Updated
Opis\Database\Schema\Compiler\MySQL::handleTypeDecimalmethod - Updated
Opis\Database\Schema\Compiler\PostgreSQL::handleTypeDecimalmethod
- Fixed a bug in
Opis\Database\Model::__setmethod
- Added missing use statement for
DateTimeclass inOpis\Database\Model - Added support for custom cast handling
- Fixed a bug in
Opis\Database\Model::__getandOpis\Database\Model::__set
- Added
linkandunlinkmethods toOpis\Database\ORM\Relation\BelongsToManyclass
- Fixed a potential bug in
Opis\Database\Model::deletemethod
- Nothing
- Casting types can now be declared nullable by adding a
?mark at the end of the type name
- Fixed a bug related to nullable column handling in
Opis\Colibri\Module::__get
- Fixed a bug in
Opis\Database\Transactionclass. See issue #22.
- Nothing
- Moved
Opis\Database\ModelInterfaceinto a separate file
- Fixed a bug in
Opis\Database\Transaction::onError - Fixed CS
- Added
Opis\Database\Model::usingmethod - Added an optional
Opis\Database\Connectionargument to theOpis\Database\Model::createmethod
- Removed unused artifacts
Opis\Database\SQL\WhereInterfaceandOpis\Database\SQL\SelectStatement::addHavingClause. See issue #19 and issue #18.
Opis\Database\Model::getConnectionmethod was moved toOpis\Database\ModelInterface::getConnectionModelclass implementsModelInterfaceinterface and you must provide an implementation for theOpis\Database\ModelInterface::getConnectionmethod- The constructor of the
Opis\Database\Modelclass accepts an optionalOpis\Database\Connectionargument
- Added
Opis\Database\ResultSet::columnmethod. See issue #10
- The
Opis\Database\Model::getConnectionmethod is not abstract anymore. See issue issue #11
- The second argument of the
Opis\Database\Connection::columnmethod is now optional.
- Added
Opis\Database\SQL\Compiler::getDateFormatmethod - Added support for ORM
- Addes support for joins in
UPDATEstatementes - Added .gitattributes file
- Added
Opis\Database\Connection::setDateFormatmethod. The method allows you to set the date format used by the compiler. - Added
Opis\Database\Connection::setWrapperFormatmethod. The method allows you to set the identifier wrapper used by the compiler. - Added support for
NULLvalues ordering
- Removed deprecated
Opis\Database\Schema\AlterTable::addPrimarymethod - Removed deprecated
Opis\Database\Schema\AlterTable::addUniquemethod - Removed deprecated
Opis\Database\Schema\AlterTable::addIndexmethod - Removed deprecated
Opis\Database\Schema\AlterTable::addForeignmethod - Removed
Opis\Database\DSNclass and all other classes that were under theOpis\Database\DSNnamespace
- Moved classes that were under the
Opis\Database\Compilernamespace toOpis\Database\SQL\Compilernamespace
- Fixed a bug in
Opis\Database\SQL\Compiler::sqlFunctionROUND - Fixed some bugs in
Opis\Database\Compiler\MySQLcompiler class
- Added
primary,unique,indexandforeignmethods toOpis\Database\Schema\AlterTableclass - Added
Opis\Database\Connection::schemamethod - Added
Opis\Database\Schema::getColumnsmethod
- The third argument of the
Opis\Database\Schema\AlterTable::renameColumnmethod was removed
- Improved schema compilers
- The
addPrimary,addUnique,addIndexandaddForeignmethods were deprecated inOpis\Database\Schema\AlterTableclass - Changed
Opis\Database\Database::schemamethod. The schema object is now returned from the connection object. - Schema compilers now takes as an argument the current connection
- Various bugs
- Added an optional parameter to
Opis\Database\Connection's constructor method. The parameter can be used to specify a the driver used by the current connection - Added
Opis\Database\Connection::drivermethod - Added
Opis\Database\Schema\Compiler\SQLiteclass. This class provides schema support for SQLite
- Newly added
incrementanddecrementmethods can now be used when a row is updated - Improvements
- Bugfixes
branch-aliasfromcomposer.jsonfile
- Fixed a bug that prevented boolean values to be as default value for a table's column.
- Fixed a bug where
textandbinarytypes were not mapped correctly.
- Fixed a bug (see #4)
- Modified
persistentmethod inOpis\Database\Connection. The method accepts now an optional boolean argument that specify if the connection should pe persistent or not. - Added
disconnectmethod inOpis\Database\Connection - Added
renameTablemethod inOpis\Database\Schema\Compiler - Added
renameTablemethod inOpis\Database\Schema - The
Opis\Database\Schema\BaseTable'snullablemethod was deprecated. - Fixed several bugs in
Opis\Database\Schema\Compiler - Modified the
pdomethod inOpis\Database\Transaction. ThePDOobject is no longer stored as a property, in order to avoid keeping the connection alive after thedisconnectmethod was called.
- Fixed a bug in
Opis\Database\Schema\Complierclass.
- Added
is,eq,isNot,ne,lessThan,lt,greaterThan,gt,atLeast,gte,atMost,lte,between,notBetween,in,notIn,like,notLike,isNullandnotNullmethods. This methods are used in conjunction with thewhere,andWhereandorWheremethods. - Added
schemamethod to theOpis\Database\Databaseclass.
- Removed
whereBetween,andWhereBetween,orWhereBetween,whereNotBetween,andWhereNotBetweenandorWhereNotBetweenmethods fromOpis\Database\SQL\WhereConditionclass. - Removed
whereIn,andWhereIn,orWhereIn,whereNotIn,andWhereNotInandorWhereNotInmethods fromOpis\Database\SQL\WhereConditionclass. - Removed
whereLike,andWhereLike,orWhereLike,whereNotLike,andWhereNotLikeandorWhereNotLikemethods fromOpis\Database\SQL\WhereConditionclass. - Removed
whereNull,andWhereNull,orWhereNull,whereNotNull,andWhereNotNullandorWhereNotNullmethods fromOpis\Database\SQL\WhereConditionclass. - Removed
executemethod fromOpis\Database\SQL\Updateclass.
- This is a full API change
- Changed
where,andWhereandorWheremethods of theOpis\Database\SQL\WhereConditionclass. The methods accepts now a single argument, representing a column or a closure used to group conditions. - Modified
join,leftJoin,rightJoin,fullJoinmethods of theOpis\Database\SQL\WhereJoinConditionclass. - Modified
havingmethod of theOpis\Database\SQL\SelectStatementclass. - Changed
setmethod of theOpis\Database\SQL\Updateclass. - The schema builder is now officially supported, although it is still marked as experimental.
insertcommand
- Autoload file
- Fixed a bug in
Opis\Database\SQL\Whereclass.
- An extra optional argument to the
servermethod ofOpis\Database\DSN\SQLServerclass - Code comments
portmethod fromOpis\Database\DSN\SQLServerclass
- Fixed a bug in
Opis\Database\DSN\SQLiteclass
- Changelog