yandex-qatools / postgresql-embedded

Embedded PostgreSQL Server
Other
493 stars 90 forks source link

Add start method which takes IRuntimeConfig without List<String> additionalParams #154

Open LukeButters opened 5 years ago

LukeButters commented 5 years ago

Hi

Could a start method be added which looks like this:

    public String start(IRuntimeConfig runtimeConfig, String host, int port, String dbName, String user, String password) throws IOException {
        return start(runtimeConfig, host, port, dbName, user, password, additionalParams, DEFAULT_ADD_PARAMS, DEFAULT_POSTGRES_PARAMS);
    }

So that it is possible to set it up like:

final String url = postgres.start(cachedRuntimeConfig(new File("target/embeddedPostgress").toPath()), 
                    "localhost", 12345, "name", "user", "pass");

Otherwise I would have to copy the private static List DEFAULT_ADD_PARAMS into the calling class then pass in those arguments.

I guess the alternative would be to make DEFAULT_ADD_PARAMS public although if that is done it would need to be wrapped in a unmodifiable list.