Commit 295c3b80 authored by Taylor Otwell's avatar Taylor Otwell

add sqlite query driver.

parent 4822f847
...@@ -83,6 +83,9 @@ class Connection { ...@@ -83,6 +83,9 @@ class Connection {
case 'mysql': case 'mysql':
return $this->grammar = new Query\Grammars\MySQL($this); return $this->grammar = new Query\Grammars\MySQL($this);
case 'sqlite':
return $this->grammar = new Query\Grammars\SQLite($this);
case 'sqlsrv': case 'sqlsrv':
return $this->grammar = new Query\Grammars\SQLServer($this); return $this->grammar = new Query\Grammars\SQLServer($this);
......
<?php namespace Laravel\Database\Query\Grammars;
use Laravel\Database\Query;
class SQLite extends Grammar
{
/**
* Compile the ORDER BY clause for a query.
*
* @param Query $query
* @return string
*/
protected function orderings(Query $query)
{
foreach ($query->orderings as $ordering)
{
$sql[] = $this->wrap($ordering['column']).' COLLATE NOCASE '.strtoupper($ordering['direction']);
}
return 'ORDER BY '.implode(', ', $sql);
}
}
\ No newline at end of file
...@@ -37,7 +37,7 @@ class URI { ...@@ -37,7 +37,7 @@ class URI {
// We'll simply get the path info from the Symfony Request instance and then // We'll simply get the path info from the Symfony Request instance and then
// format to meet our needs in the router. If the URI is root, we'll give // format to meet our needs in the router. If the URI is root, we'll give
// back a single slash, otherwise we'll strip the slashes. // back a single slash, otherwise we'll strip all of the slashes off.
$uri = static::format(Request::getPathInfo()); $uri = static::format(Request::getPathInfo());
static::segments($uri); static::segments($uri);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment