Skip to content
Permalink
Browse files

Shift traits around.

This solves the parent + child drivers from including sql related
traits. Instead the child class includes only its platform related
trait.
  • Loading branch information...
markstory committed Mar 25, 2013
1 parent c24d6e6 commit b7f1848f5d4a64350de6973a531713c0d9b22cba
@@ -18,13 +18,30 @@
namespace Cake\Model\Datasource\Database\Dialect;
use Cake\Error;
use Cake\Model\Datasource\Database\SqlDialectTrait;
/**
* Contains functions that encapsulates the SQL dialect used by MySQL,
* including query translators and schema introspection.
*/
trait MysqlDialectTrait {
use SqlDialectTrait;
/**
* String used to start a database identifier quoting to make it safe
*
* @var string
*/
public $startQuote = '`';
/**
* String used to end a database identifier quoting to make it safe
*
* @var string
*/
public $endQuote = '`';
/**
* Get the SQL to list the tables in MySQL
*
@@ -20,13 +20,30 @@
use Cake\Model\Datasource\Database\Expression\UnaryExpression;
use Cake\Model\Datasource\Database\Expression\FunctionExpression;
use Cake\Model\Datasource\Database\Query;
use Cake\Model\Datasource\Database\SqlDialectTrait;
/**
* Contains functions that encapsulates the SQL dialect used by Postgres,
* including query translators and schema introspection.
*/
trait PostgresDialectTrait {
use SqlDialectTrait;
/**
* String used to start a database identifier quoting to make it safe
*
* @var string
**/
public $startQuote = '"';
/**
* String used to end a database identifier quoting to make it safe
*
* @var string
**/
public $endQuote = '"';
/**
* Returns a query that has been transformed to the specific SQL dialect
* by changing or re-arranging SQL clauses as required.
@@ -19,9 +19,26 @@
use Cake\Model\Datasource\Database\Expression\FunctionExpression;
use Cake\Model\Datasource\Database\Query;
use Cake\Model\Datasource\Database\SqlDialectTrait;
trait SqliteDialectTrait {
use SqlDialectTrait;
/**
* String used to start a database identifier quoting to make it safe
*
* @var string
**/
public $startQuote = '"';
/**
* String used to end a database identifier quoting to make it safe
*
* @var string
**/
public $endQuote = '"';
/**
* Returns an dictionary of expressions to be transformed when compiling a Query
* to SQL. Array keys are method names to be called in this class
@@ -26,8 +26,6 @@
**/
abstract class Driver {
use SqlDialectTrait;
/**
* Establishes a connection to the database server
*
@@ -25,20 +25,6 @@ class Mysql extends \Cake\Model\Datasource\Database\Driver {
use PDODriverTrait;
use MysqlDialectTrait;
/**
* String used to start a database identifier quoting to make it safe
*
* @var string
**/
public $startQuote = '`';
/**
* String used to end a database identifier quoting to make it safe
*
* @var string
**/
public $endQuote = '`';
/**
* Base configuration settings for MySQL driver
*
@@ -19,20 +19,6 @@
trait SqlDialectTrait {
/**
* String used to start a database identifier quoting to make it safe
*
* @var string
**/
public $startQuote = '"';
/**
* String used to end a database identifier quoting to make it safe
*
* @var string
**/
public $endQuote = '"';
/**
* Quotes a database identifier (a column name, table name, etc..) to
* be used safely in queries without the risk of using reserver words

0 comments on commit b7f1848

Please sign in to comment.
You can’t perform that action at this time.