Poyan N Fri Jan 07 09:24:04 -0500 2011

Subject: SQLITE :memory: databases and Connection::instance()

I can't seem to be getting an instance of Connection whilst using an in memory Sqlite database. Here's the code:

$config = ActiveRecord\Config::instance();
$config->set_model_directory('models');
$config->set_connections(array(
'sqlite'=>'sqlite://uas.sqlite' # This works
  1. 'sqlite'=>'sqlite::memory:' # This won't work
    ), 'sqlite');
  1. Initialize database
    $connection = ActiveRecord\Connection::instance('sqlite');

I get a "Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'Database host must be specified in the connection string.' in E:\Dropbox\My Dropbox\Projects\PHP\uas\libs\php-activerecord\lib\Connection.php on line 146" if I try to get the connection to the in memory database, but it works as expected using the file database.

Any ideas?