You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"The best PDO wrapper" can be improved by adding support for other database drivers such as SQLite. This can be done by introducing two new variables: DB_DRIVER and DB_PATH.
// SQLite example
define('DB_DRIVER', 'sqlite');
define('DB_PATH', '/data/songs.db');
// Another SQLite example
define('DB_DRIVER', 'sqlite');
define('DB_PATH', ':memory:');
// These are all valid DSN strings for SQLite and should be supported.
$dsn = 'sqlite:c:\full\path\to\name.db';
$dsn = 'sqlite:..\data\name.db';
$dsn = 'sqlite:name.db';
The variables will be used in the DB::instance() method, something along these lines (untested code):
"The best PDO wrapper" can be improved by adding support for other database drivers such as SQLite. This can be done by introducing two new variables: DB_DRIVER and DB_PATH.
The variables will be used in the DB::instance() method, something along these lines (untested code):
On a side-note, you may also consider introducing a single DB_DSN variable that can be used instead of DB_HOST, DB_NAME and DB_CHAR.
Why? Because I like the idea of having full access to the DSN string.
My config.php could then look like this:
And,
Instead of:
The text was updated successfully, but these errors were encountered: