Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How could i set a schema in the test? #48

Closed
thurrio opened this issue Apr 11, 2019 · 2 comments
Closed

How could i set a schema in the test? #48

thurrio opened this issue Apr 11, 2019 · 2 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@thurrio
Copy link

thurrio commented Apr 11, 2019

When the class EmbeddedPostgres create the jdbc url, the parameter are defined in the static string

private static final String JDBC_FORMAT = "jdbc:postgresql://localhost:%s/%s?user=%s";

How could I add the currentSchema ?
Can I open a PR with the changes?

@thurrio
Copy link
Author

thurrio commented Apr 11, 2019

I found a way to set

@Configuration
class EmbeddedPostgresConfiguration {
    @Bean
    fun embeddedPostgresCustomizer(): Consumer<EmbeddedPostgres.Builder> {
        return Consumer { builder -> builder.setConnectConfig("currentSchema", "schema_name") }
    }
}

@thurrio thurrio closed this as completed Apr 11, 2019
@tomix26
Copy link
Collaborator

tomix26 commented Apr 11, 2019

You can also set it through zonky.test.database.postgres.client.properties.currentSchema=xxx property.
More information about general configuration is described at https://github.com/zonkyio/embedded-database-spring-test#common-configuration

@tomix26 tomix26 added the status: invalid An issue that we don't feel is valid label Apr 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

2 participants