mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-22 15:10:02 +00:00
#2647 - When Postgres + isAllQuotedIdentifiers true + using DataSourceConfig THEN datasourceConfig.addProperty("quoteReturningIdentifiers", false);
I think there is not a case where we do NOT want to do this. allQuotedIdentifiers + Postgres is almost not usable without this.
This commit is contained in:
1 parent
f92887b2f0
commit
244f336f54
2 files changed
+45
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package io.ebeaninternal.server.core;
|
||||
|
||||
import io.ebean.annotation.Platform;
|
||||
import io.ebean.config.DatabaseConfig;
|
||||
import io.ebean.datasource.DataSourceAlertFactory;
|
||||
import io.ebean.datasource.DataSourceConfig;
|
||||
@@ -97,10 +98,16 @@ final class InitDataSource {
|
||||
dsConfig.setReadOnly(true);
|
||||
dsConfig.setDefaults(config.getDataSourceConfig());
|
||||
dsConfig.setIsolationLevel(config.getDataSourceConfig().getIsolationLevel());
|
||||
} else if (isPostgresAllQuotedIdentifiers()) {
|
||||
dsConfig.addProperty("quoteReturningIdentifiers", false);
|
||||
}
|
||||
return create(dsConfig, readOnly);
|
||||
}
|
||||
|
||||
boolean isPostgresAllQuotedIdentifiers() {
|
||||
return config.isAllQuotedIdentifiers() && Platform.POSTGRES == config.getDatabasePlatform().getPlatform().base();
|
||||
}
|
||||
|
||||
private DataSource create(DataSourceConfig dsConfig, boolean readOnly) {
|
||||
String poolName = config.getName() + (readOnly ? "-ro" : "");
|
||||
return DataSourceFactory.create(poolName, dsConfig);
|
||||
|
||||
Reference in new issue
Block a user