From 295c3b80c26c4b55d13e03640f71c82bd14dbca1 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 3 May 2012 08:28:40 -0500 Subject: [PATCH] add sqlite query driver. --- laravel/database/connection.php | 3 +++ laravel/database/query/grammars/sqlite.php | 24 ++++++++++++++++++++++ laravel/uri.php | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 laravel/database/query/grammars/sqlite.php diff --git a/laravel/database/connection.php b/laravel/database/connection.php index a93dd1f6..751be69e 100644 --- a/laravel/database/connection.php +++ b/laravel/database/connection.php @@ -83,6 +83,9 @@ protected function grammar() case 'mysql': return $this->grammar = new Query\Grammars\MySQL($this); + case 'sqlite': + return $this->grammar = new Query\Grammars\SQLite($this); + case 'sqlsrv': return $this->grammar = new Query\Grammars\SQLServer($this); diff --git a/laravel/database/query/grammars/sqlite.php b/laravel/database/query/grammars/sqlite.php new file mode 100644 index 00000000..cacc936e --- /dev/null +++ b/laravel/database/query/grammars/sqlite.php @@ -0,0 +1,24 @@ +orderings as $ordering) + { + $sql[] = $this->wrap($ordering['column']).' COLLATE NOCASE '.strtoupper($ordering['direction']); + } + + return 'ORDER BY '.implode(', ', $sql); + } + +} \ No newline at end of file diff --git a/laravel/uri.php b/laravel/uri.php index ad297acf..2477fe62 100644 --- a/laravel/uri.php +++ b/laravel/uri.php @@ -37,7 +37,7 @@ public static function current() // 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 - // 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()); static::segments($uri);