Reputation: 1145
I've used JHipster 3.12.2 (Spring Boot) with H2 (disk, not memory) to develop a small demo app (3 or 4 entity tables, a half dozen of most entities, and 48 images embedded as ImageBlobs in the database, as generated using JHipster JDL). When I generated the app I selected Postgresql as the production database, since H2 isn't a choice ... but I've run into some problem with the dockerized version (it's really slow, need to put Docker on his machine, need to figure out how to re-initialize data, etc) so I'm wondering if there's an easy way to just embed H2 as my "production" DB for this? (And then I could reuse the CSV files and data loading scripts I used in development)
Upvotes: 3
Views: 838
Reputation: 88
Just to complete David answer:
from application-dev:
1-datasource
uri : jdbc:h2:mem:yourapp;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=LEGACY
2- h2
console: enabled: true
3- jpa
liquibase: contexts: prod, faker
Upvotes: 0
Reputation: 3145
Well, it's as easy as copying the datasource
and jpa
relevant configurations from application-dev.yml into application-prod.yml, to point tell it should load h2 drivers instead of psql.
However I would not suggest to take h2 as real production, as there is a lack of management tools to this database, as h2 isn't used to be choosen for that. If you are not using Postgres, you still can switch to mysql for production, if that fits better your needs.
Upvotes: 4