refactoring database.
This commit is contained in:
@@ -14,11 +14,16 @@ class Factory {
|
||||
*/
|
||||
public static function make($table, Connection $connection)
|
||||
{
|
||||
switch ($connection->driver())
|
||||
$query = (isset($connection->config['query'])) ? $connection->config['query'] : $connection->driver();
|
||||
|
||||
switch ($query)
|
||||
{
|
||||
case 'postgres':
|
||||
case 'pgsql':
|
||||
return new Postgres($table, $connection);
|
||||
|
||||
case 'mysql':
|
||||
return new MySQL($table, $connection);
|
||||
|
||||
default:
|
||||
return new Query($table, $connection);
|
||||
}
|
||||
|
||||
16
laravel/db/query/mysql.php
Normal file
16
laravel/db/query/mysql.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php namespace Laravel\DB\Query;
|
||||
|
||||
use Laravel\DB\Query;
|
||||
|
||||
class MySQL extends Query {
|
||||
|
||||
/**
|
||||
* Get the keyword identifier wrapper for the connection.
|
||||
*
|
||||
* MySQL uses a non-standard wrapper
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function wrapper() { return '`'; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user