Skip to content

folio-org/vertx-mysql-postgresql-client

 
 

Repository files navigation

Vert.x MySQL PostgreSQL client

Build Status

This Vert.x client uses the Mauricio Linhares driver to support a fully async client for MySQL and PostgreSQL.

Please see the in source asciidoc documentation or the main documentation on the web-site for a full description:

Running test suite

The test suite embeds PostgreSQL and MySQL with

  • ru.yandex.qatools.embed:postgresql-embedded

  • com.wix:wix-embedded-mysql

You can also run your own server instead by providing hosts

> mvn test -DmysqlHost=localhost -DpostgresqlHost=localhost
  • For testing PostgreSQL: A testdb database on a local PostgreSQL install and a user called vertx with password password

  • For testing MySQL: A testdb database on a local MySQL install and a user called vertx with password password

When needed these properties can be overriden

  • postgresqlHost: empty ⇒ start an embedded DB

  • postgresqlPort=5432

  • postgresqlSslPort=54321

  • postgresqlDatabase=testdb

  • postgresqlUsername=vertx

  • postgresqlPassword=password

  • mysqlHost: empty ⇒ start an embedded DB

  • mysqlPort=3306

  • mysqlDatabase=testdb

  • mysqlUsername=vertx

  • mysqlPassword=password

e.g:

> mvn test -DpostgresqlPort=5432 -DpostgresqlSslPort=54321 -DmysqlPort=3306

Setting up test databases with Docker:

docker run --rm --name vertx-postgres -e POSTGRES_USER=vertx -e POSTGRES_PASSWORD=password -e POSTGRES_DB=testdb -p 5432:5432 postgres
docker run --rm --name vertx-postgres-ssl -p 54321:5432 \
  -e POSTGRES_USER=vertx \
  -e POSTGRES_PASSWORD=password \
  -e POSTGRES_DB=testdb \
  -v $(pwd)/src/test/resources/ssl-docker/server.crt:/docker-entrypoint-initdb.d/server.crt \
  -v $(pwd)/src/test/resources/ssl-docker/server.key:/docker-entrypoint-initdb.d/server.key \
  -v $(pwd)/src/test/resources/ssl-docker/init.sh:/docker-entrypoint-initdb.d/init.sh \
  postgres
Note
If you’re working with Fedora, CentOS or RHEL and have selinux enabled, you need to add :z to the volume options. Otherwise Postgres won’t be able to read the SSL setup files. For more details, read Using Volumes with Docker can Cause Problems with SELinux.
docker run --rm --name vertx-mysql -e MYSQL_ROOT_PASSWORD=password -e MYSQL_USER=vertx -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=testdb -p 3306:3306 mysql/mysql-server:5.6

About

Fork with idle connections being released after some time

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 98.4%
  • Shell 1.6%