https://github.com/quarkiverse/quarkus-embedded-postgresql
Allowing you to unit test with a PostgreSQL DB without requiring end users to install and set up a database cluster
https://github.com/quarkiverse/quarkus-embedded-postgresql
embedded-database embedded-db embedded-postgresql postgresql quarkus-extension zonkyo
Last synced: 5 months ago
JSON representation
Allowing you to unit test with a PostgreSQL DB without requiring end users to install and set up a database cluster
- Host: GitHub
- URL: https://github.com/quarkiverse/quarkus-embedded-postgresql
- Owner: quarkiverse
- License: apache-2.0
- Created: 2023-02-10T12:51:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T14:06:16.000Z (about 1 year ago)
- Last Synced: 2025-04-03T00:25:21.943Z (about 1 year ago)
- Topics: embedded-database, embedded-db, embedded-postgresql, postgresql, quarkus-extension, zonkyo
- Language: Java
- Homepage: https://github.com/zonkyio/embedded-postgres
- Size: 223 KB
- Stars: 10
- Watchers: 5
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Quarkus - Embedded PostgreSQL
[](https://search.maven.org/artifact/io.quarkiverse.embedded-postgresql/quarkus-embedded-postgresql)
[](https://opensource.org/licenses/Apache-2.0)
[](https://github.com/quarkiverse/quarkus-embedded-postgresql/actions/workflows/build.yml)
An alternative to quarkus-jdbc-postgres that rather than instantiating a pgsql server, uses zonky embedded library, reducing memory footprint.
It is mainly oriented for single pod k8s deployments or integration testing.
## Usage
Include this dependency in your pom
```
io.quarkiverse.embedded.postgresql
quarkus-embedded-postgresql
```
You can now inject in your code a DataSource object (if you are JDBC friend) or a PgPool reference (if you prefer reactive) without adding any further property.
### Configuration properties
| property | description |
|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| `quarkus.embedded.postgresql.data.dir` | You can optionally persist information into file system by setting the desired path as value of property |
| `quarkus.embedded.postgresql.port` | You can optinally configure the postgresql server port by using this property. If no value is confirured a random available port will be selected. |
| `quarkus.embedded.postgresql.listen-address` | You can optionally configure the host(s) (listen_addresses) for the PostgreSQL server; if not set, localhost is used. Valid values include localhost, 0.0.0.0, ::, *, a specific hostname or IP (e.g. db.mycompany.local, 192.168.1.100), or multiple comma-separated addresses. |
### Multiple Datasources
This extension supports the usage of multiple datasources when the application has more than datasource which are defined by a specific name for each one of them,
see the [datasources guide](https://quarkus.io/guides/datasource#multiple-datasources) for more details.
The extension uses the configuration of each named datasource matching the `db-kind` property to automatically create the databases on the embedded PostgreSQL for
each defined datasource and inject the proper configuration intro the application, such as the URL for the datasource.
[](#contributors-)
## Contributors ✨
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

Francisco Javier Tirado Sarti
💻 🚧

Ricardo Zanini
💻 🚧
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!