Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
<title>Cockroach | Ebean ORM</title>
<meta name="layout" content="_layout2/base-docs.html"/>
<meta name="bread1" content="Database platforms" href="/docs/database"/>
<meta name="bread2" content="Cockroach" href="/docs/database/cockroach"/>
<#assign n0_docs="active">
<#assign n1_platforms="active">
<#assign n2_cockroach="active">
To test against Cockroach docker test container set the <em>platform</em> to <code>cockroach</code> in
Refer to <a href="/docs/testing">docs / testing</a> if application-test.yaml doesn't exist yet.
<pre content="yml">
platform: cockroach #, h2, postgres, mysql, oracle, sqlserver
ddlMode: dropCreate # none | dropCreate | migrations | create
dbName: test
<h2 id="ebean-cockroach">ebean-cockroach dependency</h2>
We can use the <code>io.ebean:ebean-cockroach</code> dependency rather than <code>io.ebean:ebean</code> if we want to only
bring in the CockroachDB specific platform code. Depending on <code>io.ebean:ebean</code> will bring in all platforms.
<h2 id="starting">Docker container</h2>
We can programmatically start a docker container version of CockroachDB.
The below uses <code>ebean-test-docker</code> dependency which already comes with <code>ebean-test</code>.
If we do not have a dependency on <code>ebean-test</code> then add <code>io.ebean:ebean-test-docker:5.0</code>
as a dependency.
<pre content="java">
package main;
import io.ebean.docker.commands.CockroachContainer;
public class Main {
public static void main(String[] args) {
CockroachContainer container = CockroachContainer.newBuilder("v21.2.9")
<@next_edit "YugabyteDB" "/docs/database/yugabyte" "/docs/database/cockroach/index.html"/>