Extract DatabaseConfig read from env vars into own function.
Context
Creating a database connection using ign-go
without instancing a new server is currently quite hard. Calling InitDbWithCfg
requires a configured DatabaseConfig
instance. Since applications that use ign-go
typically work with env vars, it would make sense to get a configured DatabaseConfig
instance from env vars. The only place where you can currently get this is inside the Server.readPropertiesFromEnvVars
method, which configures, among other things, the dbConfig
property of the server.
Change
This PR extracts the code from the Server.readPropertiesFromEnvVars
method as a standalone function GetDatabaseConfigFromEnvVars
, so that database connections can be opened without requiring a server.
Other information
This will be used in Cloudsim to create package-specific unit tests.