Sometimes guys you can post something that sets off a spark in someone else so be careful
[QUOTE=Ren;4951636]
$pdo = new PDO('sqlite::memory:', '', '');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('CREATE TABLE Test(id INTEGER NOT NULL PRIMARY KEY, name TEXT)');
$pdo->exec('INSERT INTO Test(name) VALUES(\\'Rod\\')');
$pdo->exec('INSERT INTO Test(name) VALUES(\\'Jane\\')');
$pdo->exec('INSERT INTO Test(name) VALUES(\\'Freddy\\')');
$pdo->exec('INSERT INTO Test(name) VALUES(\\'Tom\\')');
$pdo->exec('INSERT INTO Test(name) VALUES(\\'Dick\\')');
$pdo->exec('INSERT INTO Test(name) VALUES(\\'Harry\\')');
$q = $pdo->prepare('SELECT id, name FROM Test ORDER BY name ASC');
$q->execute();
$r = $q->fetchAll(PDO::FETCH_GROUP|PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC);
var_dump($r);
[/quote]
Before this example by Ren I didnāt know about āsqlite::memoryā as a database. I still donāt know that much but I have modified my database class to accept itās dsn with no user and password for the purpose of testing. An SQL db that exists entirely in memory has enormous advantages over having an active database for testing since the test can create a fresh database, compose the tables and test data required for the test and then execute the test. More importantly configuration and connectivity issues with the database donāt affect the test at hand although they will of course receive their own tests.
What Iād like to know is this - what are the differences between SQLLite and MySQL - because these differences will obviously control what I can test for and how the tests are written. Iām going to presume SQLLite doesnāt support ENUM and REPLACE INTO and for database portability I donāt use those features of MySQL because they are unique to it.
(Well, that isnāt entirely true - I donāt use them in my framework heart. I might use them in specific projects, but not in the belly of the beast as it were).
Any good online documentation on SQLLlite someone could point me to?