H2
Testing
To test using H2 set the platform to h2
in
src/test/resources/application-test.yaml
Refer to docs / testing if application-test.yaml doesn't exist yet.
ebean:
test:
platform: h2 # h2, postgres, mysql, oracle, sqlserver
ddlMode: dropCreate # none | dropCreate | migrations
dbName: test
The above will use the following defaults:
url: | jdbc:h2:mem:{databaseName} |
---|---|
driver: | org.h2.Driver |
ebean-h2 dependency
We can use the io.ebean:ebean-h2
dependency rather than io.ebean:ebean
if we want to only
bring in the H2Database specific platform code. Depending on io.ebean:ebean
will bring in all platforms.
Types
UUID
UUID is a native H2 type.
History support
History support for H2 is provided by generating triggers and history table.