-
-
Notifications
You must be signed in to change notification settings - Fork 144
Closed
Labels
Description
How about we change our database config like so?
return new DatabaseConfig(
connections: [
'main' => new SQLiteConnection(
path: 'database.sqlite'
),
'backup' => new MysqlConnection(
// …
),
// …
]
);We'd change the name of the interface Driver to Connection, I think that makes more sense anyway.
By default, the first registered connection is used. However, users can manually switch their connection:
(new Query($sql))->connection('backup')->execute();We'd need to consider whether we want the DatabaseModel trait to allow for connection switching on per-model basis. That's up for debate, although I lean more towards no.
trollfalgar