Skip to content

Commit

Permalink
persistent h2
Browse files Browse the repository at this point in the history
  • Loading branch information
januschung committed Jan 31, 2025
1 parent 3f401a7 commit 6f89d78
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ mvnw
mvnw.cmd

.idea

data/
pgdata/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ mvn clean install
java -jar target/job-winner-0.0.1-SNAPSHOT.jar
```

Alternatively, you can run the java app with h2 database:
```console
# Initializing and Running the Application with H2 Database (first time only)
java -jar target/job-winner-0.0.1-SNAPSHOT.jar --spring.profiles.active=h2 --spring.sql.init.mode=always

# Starting the Application When Database Already Exists
java -jar target/job-winner-0.0.1-SNAPSHOT.jar --spring.profiles.active=h2
```
Please follow the build instruction from the [UI repo](https://github.com/januschung/job-winner-ui) to bring up the UI.

## Contributing
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/application-h2.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
spring.r2dbc.url=r2dbc:h2:mem:///job-winner?options=DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
spring.r2dbc.url=r2dbc:h2:file:///./data/job-winner
spring.r2dbc.username=sa
spring.r2dbc.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.hibernate.ddl-auto=none

0 comments on commit 6f89d78

Please sign in to comment.