#1344 - ENH: Add initial Cockroach DB support ... need to review JSON

Adds in the DB ARRAY support (exactly the same as Postgres)
This commit is contained in:
Rob Bygrave
2018-03-09 17:40:34 +13:00
parent 8ac1b745df
commit eda6350d89
8 changed files with 68 additions and 18 deletions
@@ -189,8 +189,8 @@ public final class DefaultTypeManager implements TypeManager {
this.extraTypeFactory = new DefaultTypeFactory(config);
this.postgres = isPostgres(config.getDatabasePlatform());
this.arrayTypeListFactory = arrayTypeListFactory(postgres, config.getDatabasePlatform());
this.arrayTypeSetFactory = arrayTypeSetFactory(postgres, config.getDatabasePlatform());
this.arrayTypeListFactory = arrayTypeListFactory(config.getDatabasePlatform());
this.arrayTypeSetFactory = arrayTypeSetFactory(config.getDatabasePlatform());
this.offlineMigrationGeneration = DbOffline.isGenerateMigration();
@@ -211,8 +211,8 @@ public final class DefaultTypeManager implements TypeManager {
/**
* Return the factory to use to support DB ARRAY types.
*/
private PlatformArrayTypeFactory arrayTypeListFactory(boolean postgres, DatabasePlatform databasePlatform) {
if (postgres) {
private PlatformArrayTypeFactory arrayTypeListFactory(DatabasePlatform databasePlatform) {
if (databasePlatform.isNativeArrayType()) {
return ScalarTypeArrayList.factory();
} else if (databasePlatform.isPlatform(Platform.H2)) {
return ScalarTypeArrayListH2.factory();
@@ -224,8 +224,8 @@ public final class DefaultTypeManager implements TypeManager {
/**
* Return the factory to use to support DB ARRAY types.
*/
private PlatformArrayTypeFactory arrayTypeSetFactory(boolean postgres, DatabasePlatform databasePlatform) {
if (postgres) {
private PlatformArrayTypeFactory arrayTypeSetFactory(DatabasePlatform databasePlatform) {
if (databasePlatform.isNativeArrayType()) {
return ScalarTypeArraySet.factory();
} else if (databasePlatform.isPlatform(Platform.H2)) {
return ScalarTypeArraySetH2.factory();