All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- Support for PHP 8
- Bug in
mid
function
nop
function (no operation) towhere
conditions
- 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
,JOIN
andON
- Support for aliased expressions in
SELECT
statement CROSS JOIN
support inOpis\Database\SQL\BaseStatement::crossJoin
(there is noON
clause)- Static method
Opis\Database\SQL\Expression::fromClosure
HAVING
statements not working- Array of column expressions not working
- Dependency to PDO extension in
composer.json
file
- 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
object
casting type
- Rollback.
Opis\Database\Connection::count
is no longer deprecated and is used again.
- Method
Opis\Database\Connection::count
is now deprecated andOpis\Database\Connection::command
method is used instead.
- Fixed a bug in
Opis\Database\Model::__set
method
- Added
throwExceptions
flag onOpis\Database\Model
class
- Changed exception message in
Opis\Database\Model::__get
- Fixed a bug in
Opis\Database\Model::__set
method
- Fixed a bug in
Opis\Database\ORM\BaseQuery
that 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::onlySoftDeleted
methods were added.Opis\Database\Model::destroy
andOpis\Database\Model::softDestroy
methods were added- The following methods were added to
Opis\Database\ORM\Relation
class:column
,count
,sum
,avg
,min
,max
,update
,restore
,delete
andsoftDelete
- Added support for timestamps
- Added
timestamps
andsoftDelete
methods toOpis\Database\Schema\CreateTable
- Added
update
andupdateAll
methods toOpis\Database\Model
class
- Now you can count, update, delete, soft delete and restore related models
Opis\Database\Model::getDateFormat
method is now public- The
Opis\Database\Model::assign
method now returns the current model instance
- Fixed a bug in
Opis\Database\Model::__set
method
- Added
isNewRecord
property toOpis\Database\Model
class in order to fix a bug that might occur when using custom values for primary key.
- The
__set
,save
anddelete
methods were updated to use the newly addedisNewRecord
property.
- Added
Opis\Database\Schema\BaseColumn::length
method - Added
Opis\Database\Schema\Compiler\SQLServer::handleTypeDecimal
method
- Updated
Opis\Database\Schema\Compiler\MySQL::handleTypeDecimal
method - Updated
Opis\Database\Schema\Compiler\PostgreSQL::handleTypeDecimal
method
- Fixed a bug in
Opis\Database\Model::__set
method
- Added missing use statement for
DateTime
class inOpis\Database\Model
- Added support for custom cast handling
- Fixed a bug in
Opis\Database\Model::__get
andOpis\Database\Model::__set
- Added
link
andunlink
methods toOpis\Database\ORM\Relation\BelongsToMany
class
- Fixed a potential bug in
Opis\Database\Model::delete
method
- 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\Transaction
class. See issue #22.
- Nothing
- Moved
Opis\Database\ModelInterface
into a separate file
- Fixed a bug in
Opis\Database\Transaction::onError
- Fixed CS
- Added
Opis\Database\Model::using
method - Added an optional
Opis\Database\Connection
argument to theOpis\Database\Model::create
method
- Removed unused artifacts
Opis\Database\SQL\WhereInterface
andOpis\Database\SQL\SelectStatement::addHavingClause
. See issue #19 and issue #18.
Opis\Database\Model::getConnection
method was moved toOpis\Database\ModelInterface::getConnection
Model
class implementsModelInterface
interface and you must provide an implementation for theOpis\Database\ModelInterface::getConnection
method- The constructor of the
Opis\Database\Model
class accepts an optionalOpis\Database\Connection
argument
- Added
Opis\Database\ResultSet::column
method. See issue #10
- The
Opis\Database\Model::getConnection
method is not abstract anymore. See issue issue #11
- The second argument of the
Opis\Database\Connection::column
method is now optional.
- Added
Opis\Database\SQL\Compiler::getDateFormat
method - Added support for ORM
- Addes support for joins in
UPDATE
statementes - Added .gitattributes file
- Added
Opis\Database\Connection::setDateFormat
method. The method allows you to set the date format used by the compiler. - Added
Opis\Database\Connection::setWrapperFormat
method. The method allows you to set the identifier wrapper used by the compiler. - Added support for
NULL
values ordering
- Removed deprecated
Opis\Database\Schema\AlterTable::addPrimary
method - Removed deprecated
Opis\Database\Schema\AlterTable::addUnique
method - Removed deprecated
Opis\Database\Schema\AlterTable::addIndex
method - Removed deprecated
Opis\Database\Schema\AlterTable::addForeign
method - Removed
Opis\Database\DSN
class and all other classes that were under theOpis\Database\DSN
namespace
- Moved classes that were under the
Opis\Database\Compiler
namespace toOpis\Database\SQL\Compiler
namespace
- Fixed a bug in
Opis\Database\SQL\Compiler::sqlFunctionROUND
- Fixed some bugs in
Opis\Database\Compiler\MySQL
compiler class
- Added
primary
,unique
,index
andforeign
methods toOpis\Database\Schema\AlterTable
class - Added
Opis\Database\Connection::schema
method - Added
Opis\Database\Schema::getColumns
method
- The third argument of the
Opis\Database\Schema\AlterTable::renameColumn
method was removed
- Improved schema compilers
- The
addPrimary
,addUnique
,addIndex
andaddForeign
methods were deprecated inOpis\Database\Schema\AlterTable
class - Changed
Opis\Database\Database::schema
method. 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::driver
method - Added
Opis\Database\Schema\Compiler\SQLite
class. This class provides schema support for SQLite
- Newly added
increment
anddecrement
methods can now be used when a row is updated - Improvements
- Bugfixes
branch-alias
fromcomposer.json
file
- Fixed a bug that prevented boolean values to be as default value for a table's column.
- Fixed a bug where
text
andbinary
types were not mapped correctly.
- Fixed a bug (see #4)
- Modified
persistent
method inOpis\Database\Connection
. The method accepts now an optional boolean argument that specify if the connection should pe persistent or not. - Added
disconnect
method inOpis\Database\Connection
- Added
renameTable
method inOpis\Database\Schema\Compiler
- Added
renameTable
method inOpis\Database\Schema
- The
Opis\Database\Schema\BaseTable
'snullable
method was deprecated. - Fixed several bugs in
Opis\Database\Schema\Compiler
- Modified the
pdo
method inOpis\Database\Transaction
. ThePDO
object is no longer stored as a property, in order to avoid keeping the connection alive after thedisconnect
method was called.
- Fixed a bug in
Opis\Database\Schema\Complier
class.
- Added
is
,eq
,isNot
,ne
,lessThan
,lt
,greaterThan
,gt
,atLeast
,gte
,atMost
,lte
,between
,notBetween
,in
,notIn
,like
,notLike
,isNull
andnotNull
methods. This methods are used in conjunction with thewhere
,andWhere
andorWhere
methods. - Added
schema
method to theOpis\Database\Database
class.
- Removed
whereBetween
,andWhereBetween
,orWhereBetween
,whereNotBetween
,andWhereNotBetween
andorWhereNotBetween
methods fromOpis\Database\SQL\WhereCondition
class. - Removed
whereIn
,andWhereIn
,orWhereIn
,whereNotIn
,andWhereNotIn
andorWhereNotIn
methods fromOpis\Database\SQL\WhereCondition
class. - Removed
whereLike
,andWhereLike
,orWhereLike
,whereNotLike
,andWhereNotLike
andorWhereNotLike
methods fromOpis\Database\SQL\WhereCondition
class. - Removed
whereNull
,andWhereNull
,orWhereNull
,whereNotNull
,andWhereNotNull
andorWhereNotNull
methods fromOpis\Database\SQL\WhereCondition
class. - Removed
execute
method fromOpis\Database\SQL\Update
class.
- This is a full API change
- Changed
where
,andWhere
andorWhere
methods of theOpis\Database\SQL\WhereCondition
class. The methods accepts now a single argument, representing a column or a closure used to group conditions. - Modified
join
,leftJoin
,rightJoin
,fullJoin
methods of theOpis\Database\SQL\WhereJoinCondition
class. - Modified
having
method of theOpis\Database\SQL\SelectStatement
class. - Changed
set
method of theOpis\Database\SQL\Update
class. - The schema builder is now officially supported, although it is still marked as experimental.
insert
command
- Autoload file
- Fixed a bug in
Opis\Database\SQL\Where
class.
- An extra optional argument to the
server
method ofOpis\Database\DSN\SQLServer
class - Code comments
port
method fromOpis\Database\DSN\SQLServer
class
- Fixed a bug in
Opis\Database\DSN\SQLite
class
- Changelog