001package io.ebean.config.dbplatform.cockroach;
002
003import io.ebean.annotation.Platform;
004import io.ebean.config.dbplatform.postgres.PostgresPlatform;
005
006/**
007 * CockroachDB based platform.
008 */
009public class CockroachPlatform extends PostgresPlatform {
010
011  public CockroachPlatform() {
012    super();
013    this.platform = Platform.COCKROACH;
014    // no like escape clause supported
015    this.likeSpecialCharacters = new char[]{'%', '_'};
016    this.likeClauseRaw = "like ?";
017    this.likeClauseEscaped = "like ?";
018  }
019
020  /**
021   * Needs a commit after create index such that alter table add foreign key ... succeeds.
022   */
023  @Override
024  public boolean isDdlCommitOnCreateIndex() {
025    return true;
026  }
027
028}