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
Configurable table names (SQL) #941
Comments
@bartoszwalacik I'm planning to work on this feature. Was thinking of providing a TableConfiguration tableConf = TableConfigurationBuilder.tableConfiguration()
.withGlobalIdTableName("jav_global_id")
.withCommitTableName("jav_commit")
.withSnapshotTableName("jav_snapshot")
.withCommitPropertyTableName("jav_commit_property")
.build();
SqlRepositoryBuilder.sqlRepository().
withConnectionProvider(new ConnectionProvider() {
public Connection getConnection() throws SQLException {
return DriverManager.getConnection("jdbc:h2:mem:test;");
}
}).
withDialect(DialectName.H2).
withTableConfiguration(tableConf).
build(); There will be a change in the |
I think that nesting builders would be too complex, so: SqlRepositoryBuilder.sqlRepository().
withConnectionProvider(new ConnectionProvider() {
public Connection getConnection() throws SQLException {
return DriverManager.getConnection("jdbc:h2:mem:test;");
}
}).
.withDialect(DialectName.H2)
.withGlobalIdTableName("jav_global_id")
.withCommitTableName("jav_commit")
.withSnapshotTableName("jav_snapshot")
.withCommitPropertyTableName("jav_commit_property")
build(); and then, these 4 new fields are stored in public class SqlRepositoryConfiguration {
private final boolean globalIdCacheDisabled;
private final String schemaName;
private final boolean schemaManagementEnabled;
private final String globalIdTableName;
... |
Sounds good. I will start making the changes. One thing I observed in the |
Well, i guess the key names and sequence names should also be changed to reflect given table names. |
@bartoszwalacik I've made the required changes and submitted a PR. Please have a look at let me know your thoughts and comments. |
yes, i know, i will merge till friday |
new props added in SqlRepository and in the starter:
|
released in 5.10.5 |
Currently there is no way to change the default table names.
Providing a way of customizing these would be very nice.
The text was updated successfully, but these errors were encountered: