status | impl-variants |
---|---|
released |
true |
For local development and testing, CAP Java supports the H2 database, which can be configured to run in-memory.
Learn more about features and limitations of using CAP with H2{.learn-more}
::: warning Not supported for CAP Node.js. :::
[[toc]]
When a new CAP Java project is created with the Maven Archetype or with cds init
,
H2 is automatically configured as in-memory database used for development and testing in the default
profile.
To use H2, just add a Maven dependency to the H2 JDBC driver:
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
Next, configure the build to create an initial schema.sql file for H2 using cds deploy --to h2 --dry
.
In Spring, H2 is automatically initialized as in-memory database when the driver is present on the classpath.
Learn more about the configuration of H2 {.learn-more}
CAP supports most of the major features on H2:
Learn about features and limitations of H2{.learn-more}