Skip to content

Commit

Permalink
Test coverage for H2, H2-in-file and Postgres added, rudimentary doc …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
johanandren committed Feb 23, 2024
1 parent c003f78 commit 8523b0d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/native-image-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,27 @@ jobs:
run: |-
cd native-image-tests/
sbt nativeImage -Dakka.r2dbc.version=`cat ~/.version`
# run the binary
- name: Akka Persistence native image H2 inmem
run: |-
cd native-image-tests/
target/native-image/native-image-tests
- name: Akka Persistence native image H2 file
run: |-
cd native-image-tests/
target/native-image/native-image-tests -Dconfig.resource=application-h2-file.conf
- name: Start Postgres DB
run: |-
docker compose -f docker/docker-compose-postgres.yml up --wait
docker exec -i postgres-db psql -U postgres -t < ddl-scripts/create_tables_postgres.sql
- name: Akka Persistence native image H2
run: |-
cd native-image-tests/
target/native-image/native-image-tests -Dconfig.resource=application-postgres.conf
- name: Email on failure
if: ${{ failure() }}
uses: dawidd6/action-send-mail@6063705cefe50cb915fc53bb06d4049cae2953b2
Expand Down
1 change: 1 addition & 0 deletions docs/src/main/paradox/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The Akka Persistence R2DBC plugin allows for using SQL database with R2DBC as a
* [Cleanup tool](cleanup.md)
* [Migration tool](migration.md)
* [Migration Guide](migration-guide.md)
* [Native Image](native-image.md)
* [Contributing](contributing.md)

@@@
Expand Down
11 changes: 11 additions & 0 deletions docs/src/main/paradox/native-image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Building Native Images

Building native images with Akka HTTP is supported out of the box for the event sourced journal, snapshot store and
durable state store and databases:

* H2 (inmem and file)
* Postgres

Other databases can likely be used but will require figuring out and adding additional native-image metadata.

For details about building native images with Akka in general, see the @extref[Akka Documentation](akka:additional/native-image.html).
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
akka.persistence.journal.plugin = "akka.persistence.r2dbc.journal"
akka.persistence.snapshot-store.plugin = "akka.persistence.r2dbc.snapshot"
akka.persistence.state.plugin = "akka.persistence.r2dbc.state"

akka.persistence.r2dbc.connection-factory = ${akka.persistence.r2dbc.h2}
akka.persistence.r2dbc.connection-factory = {
protocol = "file"
database = "/tmp/test-h2-database"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
akka.persistence.journal.plugin = "akka.persistence.r2dbc.journal"
akka.persistence.snapshot-store.plugin = "akka.persistence.r2dbc.snapshot"
akka.persistence.state.plugin = "akka.persistence.r2dbc.state"

akka.persistence.r2dbc.connection-factory = ${akka.persistence.r2dbc.postgres}

0 comments on commit 8523b0d

Please sign in to comment.