Merge branch '3.1'
Merge branch '3.1'
Increased deprecation notification version
API New Database abstraction layer. Ticket #7429
Database abstraction broken up into controller, connector, query builder, and schema manager, each independently configurable via YAML / Injector
Creation of new DBQueryGenerator for database specific generation of SQL
Support for parameterised queries, move of code base to use these over escaped conditions
Refactor of SQLQuery into separate query classes for each of INSERT UPDATE DELETE and SELECT
Support for PDO
Minor bugfixes
Note: May includes some breaking changes
API Ability to control formatting of SQL queries generated by DBQueryBuilder
Intelligent test case assertion for comparison of SQL and updated DataListTest as proof of concept.
BUG Fixed issue with DataObject::write not reusing ID field when forceInsert is true
Updated test cases
API Renamed SQLQuery to SQLSelect. Deprecated SQLQuery.
Renamed MySQLSchema to MySQLSchemaManager
Updated documentation to include parameterised query docs
BUG Fixed issue with MySQL table creation not operating correctly. Use of symbol to identify link to mysql specific schema should prevent this issue happening again.
Fixed issue with unnecessary double spaces in field specifications causing unnecessary field refreshing.
BUG Fixed issues with test cases incorrectly handling schema updates
Updated PHPdoc to refer to new API
BUG fixed broken test case
BUG Fixed issue with components being flushed before being written to the database
BUG Altered test case to prove issue with old DataObject::write has been fixed. Previously calling write with $writeComponents = true (3.1 branch) would only work if the object had no changed fields.
Moved hasField from MySQLSchemaManager to DBSchemaManager as default implementation
PhpDoc fixes and updates
API Added Convert::id2sql for safely escaping SQL identifiers (tables, columns, databases, etc). Includes default implementation as per ANSI/Silverstripe standard method
BUG Fixed issue with SapphireTest and DatabaseTest still referring to old API
BUG Fixed various issues with unquoted column names to support postgre's strictness on identifiers
API Convert::id2sql now supports arrays
API Boolean now returns only integer values, as the column is implemented as a tinyint column. This is to satisfy postgre's strictness around parameterised column types
BUG Fixed issue with SQLUpdate trying to do multi-table updates, so reverted API to only handle the simpler single-table case
Test cases for SQLInsert and SQLUpdate
API Necessary extensions to PDOConnector to support SQLLite3
API DBSchemaManager now includes dbDataType as an abstract function
Additional PHPDoc and documentation cleanup.
Correction of DB functions pretending to return values from functions that never generate responses
Improved DataObjectTest case. Incorrect behaviour of selecting objects with lowercase class name now produces a failed test case rather than raising an error.
Updated SQLInsertTest to only test exact SQL structure if using default DBQueryBuilder. Overriding ORM modules should implement their own tests for SQL correctness.
BUG Test case for multi-row insert unfairly expected Database ORM layers to allow nulls to be inserted into non-nullable columns. Some databases such as MySQL simply substitute in the default values in these instances, but others such as SQLite crash. SQLInsert with multiple rows now requires that any column specified with a non-nullable type must have a non-null value for all inserted rows.
API DBConnector::connect now has optional parameter requesting that the database is selected during connection. This should only be incurred on database ORM that rely on this (such as SQLite3 or Azure that don't support changing databases).
BUG Included option to specify port in mysqli connector
BUG Cleaned up PDOConnector connection parameters