= The Reactive DB2 Client

== How to use it

See `src/main/java/examples/DB2ClientExamples.java`

== Testing

Out of the box, the test suite runs a Docker container using https://www.testcontainers.org/[TestContainers] by default.

Since DB2 container takes about 2 minutes to start, it is good to reuse containers across multiple runs. To container reuse, create a file at `~/.testcontainers.properties` and add the following property:

.~/.testcontainers.properties
```
testcontainers.reuse.enable=true
```

Just run the following Maven command:

```
mvn test
```

== Testing with an external database

If you want to use an external database, you must set the following environment variables:

- DB2_HOST: The hostname of the machine where DB2 is
- DB2_PORT: The port DB2 is running on
- DB2_NAME: The name of the DB2 database instance
- DB2_USER: The DB2 username
- DB2_PASS: The DB2 password

If you want to run the automated tests against an external database, you must manually populate it with the data in `src/test/resources/init.sql`

== Testing with Docker

Start a DB2 container with the following script:

```
./scripts/db2.sh
```

If you want to run the automated tests against this database, you must manually populate it with the data in `src/test/resources/init.sql`

