Skip to content

Instantly share code, notes, and snippets.

@mchelen
Last active April 4, 2017 21:34
Show Gist options
  • Select an option

  • Save mchelen/eaf0fc1b24b7a537e8095850407de3f9 to your computer and use it in GitHub Desktop.

Select an option

Save mchelen/eaf0fc1b24b7a537e8095850407de3f9 to your computer and use it in GitHub Desktop.
BEGIN TRANSACTION;
CREATE TABLE `Users` (
`id` INTEGER,
`name` TEXT
);
INSERT INTO `Users` VALUES (1,'foo');
INSERT INTO `Users` VALUES (2,'bar');
COMMIT;
<?php
$config = new \Doctrine\DBAL\Configuration();
$connectionParams = array(
'url' => 'sqlite:///:memory:',
);
$this->conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config);
$sql = file_get_contents('blah.sql');
$this->conn->exec($sql);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment