create static method
Dynamically instantiates the correct driver
Implementation
static Future<DartApiDB> create(DbConfig config) async {
late final DartApiDB db;
switch (config.type) {
case DbType.postgres:
db = PostgresDatabase(config);
break;
case DbType.mysql:
throw UnimplementedError('MySQL support is not implemented yet.');
}
await db.connect();
return db;
}