mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2547 - Cockroach identity DDL - Changing to use standard GENERATED ... AS IDENTITY syntax
This commit is contained in:
@@ -280,7 +280,7 @@ public final class InternalConfiguration {
|
||||
|
||||
private MultiValueBind createMultiValueBind(Platform platform) {
|
||||
// only Postgres at this stage
|
||||
if (platform.base() == Platform.POSTGRES || platform.base() == Platform.YUGABYTE) {
|
||||
if (platform.base() == Platform.POSTGRES || platform.base() == Platform.YUGABYTE || platform.base() == Platform.COCKROACH) {
|
||||
return new PostgresMultiValueBind();
|
||||
}
|
||||
return new MultiValueBind();
|
||||
|
||||
@@ -202,7 +202,8 @@ public final class DefaultTypeManager implements TypeManager {
|
||||
|
||||
private boolean isPostgresCompatible(DatabasePlatform databasePlatform) {
|
||||
return databasePlatform.isPlatform(Platform.POSTGRES)
|
||||
|| databasePlatform.isPlatform(Platform.YUGABYTE);
|
||||
|| databasePlatform.isPlatform(Platform.YUGABYTE)
|
||||
|| databasePlatform.isPlatform(Platform.COCKROACH);
|
||||
}
|
||||
|
||||
private boolean hstoreSupport() {
|
||||
|
||||
+1
-13
@@ -21,21 +21,9 @@ public class CockroachDdl extends PlatformDdl {
|
||||
return NativeDbArray.logicalToNative(logicalArrayType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map bigint, integer and smallint all into serial.
|
||||
*/
|
||||
@Override
|
||||
public String asIdentityColumn(String columnDefn, DdlIdentity identity) {
|
||||
if ("bigint".equalsIgnoreCase(columnDefn)) {
|
||||
return "serial";
|
||||
}
|
||||
if ("integer".equalsIgnoreCase(columnDefn)) {
|
||||
return "serial";
|
||||
}
|
||||
if ("smallint".equalsIgnoreCase(columnDefn)) {
|
||||
return "serial";
|
||||
}
|
||||
return columnDefn;
|
||||
return asIdentityStandardOptions(columnDefn, identity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package main;
|
||||
|
||||
//import io.ebean.docker.commands.CockroachConfig;
|
||||
//import io.ebean.docker.commands.CockroachContainer;
|
||||
import io.ebean.docker.commands.CockroachConfig;
|
||||
import io.ebean.docker.commands.CockroachContainer;
|
||||
|
||||
public class StartCockroach {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// CockroachConfig config = new CockroachConfig();
|
||||
// config.setDbName("unit");
|
||||
//
|
||||
// CockroachContainer container = new CockroachContainer(config);
|
||||
// container.startWithDropCreate();
|
||||
CockroachConfig config = new CockroachConfig("v21.2.4");
|
||||
config.setDbName("unit");
|
||||
|
||||
CockroachContainer container = new CockroachContainer(config);
|
||||
container.start();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user