tweaking comments in sqlite connector.

This commit is contained in:
Taylor Otwell 2011-10-15 23:33:26 -05:00
parent 87e8dbeb32
commit 48f1879b9f
2 changed files with 4 additions and 12 deletions

View File

@ -12,22 +12,19 @@ public function connect($config)
{ {
$options = $this->options($config); $options = $this->options($config);
// SQLite in-memory databases only live for the lifetime of the current request, and it
// is impossible to create two connections to the same in-memory database.
if ($config['database'] == ':memory:') if ($config['database'] == ':memory:')
{ {
return new PDO('sqlite::memory:', null, null, $options); return new PDO('sqlite::memory:', null, null, $options);
} }
// We will check for the database in the default storage directory for the application. // First, we will check for the database in the default storage directory for the
// Typically, this directory holds all of the SQLite databases for the application. // application. If we don't find the database there, we will assume the database
// name is actually a full qualified path to the database on disk and attempt
// to load it. If we still can't find it, we'll bail out.
elseif (file_exists($path = DATABASE_PATH.$config['database'].'.sqlite')) elseif (file_exists($path = DATABASE_PATH.$config['database'].'.sqlite'))
{ {
return new PDO('sqlite:'.$path, null, null, $options); return new PDO('sqlite:'.$path, null, null, $options);
} }
// If we still haven't located the database, we will assume the given database name
// is a fully qualified path to the database on disk and attempt to load it.
elseif (file_exists($config['database'])) elseif (file_exists($config['database']))
{ {
return new PDO('sqlite:'.$config['database'], null, null, $options); return new PDO('sqlite:'.$config['database'], null, null, $options);

View File

@ -110,7 +110,6 @@ public function __construct(Connection $connection, Grammars\Grammar $grammar, $
public function distinct() public function distinct()
{ {
$this->distinct = true; $this->distinct = true;
return $this; return $this;
} }
@ -123,7 +122,6 @@ public function distinct()
public function select($columns = array('*')) public function select($columns = array('*'))
{ {
$this->selects = (array) $columns; $this->selects = (array) $columns;
return $this; return $this;
} }
@ -405,7 +403,6 @@ private function dynamic_where($method, $parameters)
public function order_by($column, $direction = 'asc') public function order_by($column, $direction = 'asc')
{ {
$this->orderings[] = compact('column', 'direction'); $this->orderings[] = compact('column', 'direction');
return $this; return $this;
} }
@ -418,7 +415,6 @@ public function order_by($column, $direction = 'asc')
public function skip($value) public function skip($value)
{ {
$this->offset = $value; $this->offset = $value;
return $this; return $this;
} }
@ -431,7 +427,6 @@ public function skip($value)
public function take($value) public function take($value)
{ {
$this->limit = $value; $this->limit = $value;
return $this; return $this;
} }