-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathindex.html
69 lines (57 loc) · 1.96 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<html>
<head>
<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">
</head>
<body>
<h2>Cockroach</h2>
<h3>Testing</h3>
<p>
To test against Cockroach docker test container set the <em>platform</em> to <code>cockroach</code> in
<code>src/test/resources/application-test.yaml</code>
</p>
<p>
Refer to <a href="/docs/testing">docs / testing</a> if application-test.yaml doesn't exist yet.
</p>
<pre content="yml">
ebean:
test:
platform: cockroach #, h2, postgres, mysql, oracle, sqlserver
ddlMode: dropCreate # none | dropCreate | migrations | create
dbName: test
</pre>
<h2 id="ebean-cockroach">ebean-cockroach dependency</h2>
<p>
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.
</p>
<h2 id="starting">Docker container</h2>
<p>
We can programmatically start a docker container version of CockroachDB.
</p>
<p>
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.
</p>
<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")
.dbName("unit")
//.user("test_roach");
.build();
container.start();
}
}
</pre>
<@next_edit "YugabyteDB" "/docs/database/yugabyte" "/docs/database/cockroach/index.html"/>
</body>
</html>