ajout mode de configuration mixte, tableau ou variable ENV

This commit is contained in:
2023-11-02 23:04:35 +01:00
parent 84bf765b84
commit d67916e2ff
5 changed files with 41 additions and 16 deletions

View File

@@ -7,8 +7,8 @@ use Kletellier\PdoWrapper\Model;
use Kletellier\PdoWrapper\QueryBuilder;
test("create db",function () {
$dir = getcwd();
$db = Db::init($dir,["default","contwo"]);
$config = ["conone" => ["TYPE"=>"sqlite", "DATABASE" => ":memory:" ], "contwo"=>["TYPE"=>"sqlite", "DATABASE" => ":memory:" ]];
$db = Db::init($config,["conone","contwo"]);
$ret = $db->executeRawQuery("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT, col1 VARCHAR, date1 DATETIME);");
expect($ret)->toBe(true);