{"id":15138624,"url":"https://github.com/jklingsporn/vertx-jooq-async","last_synced_at":"2025-09-29T08:30:23.610Z","repository":{"id":57733689,"uuid":"95094994","full_name":"jklingsporn/vertx-jooq-async","owner":"jklingsporn","description":"Deprecated, use vertx-jooq instead:","archived":true,"fork":false,"pushed_at":"2018-02-21T10:13:40.000Z","size":217,"stargazers_count":28,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-22T02:13:15.662Z","etag":null,"topics":["java","jooq","vertx"],"latest_commit_sha":null,"homepage":"https://github.com/jklingsporn/vertx-jooq","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jklingsporn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-22T08:52:54.000Z","updated_at":"2023-02-19T11:05:26.000Z","dependencies_parsed_at":"2022-08-24T07:20:33.662Z","dependency_job_id":null,"html_url":"https://github.com/jklingsporn/vertx-jooq-async","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jklingsporn","download_url":"https://codeload.github.com/jklingsporn/vertx-jooq-async/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234600846,"owners_count":18858545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","jooq","vertx"],"created_at":"2024-09-26T07:42:32.106Z","updated_at":"2025-09-29T08:30:22.713Z","avatar_url":"https://github.com/jklingsporn.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deprecation warning\nI started vertx-jooq-async a couple months after working on [vertx-jooq](https://github.com/jklingsporn/vertx-jooq) to allow the same\nfeatures but using the async driver. First, I tried to incorproate it into vertx-jooq but it couldn't be done without a major\nrefactoring (which I didn't have the time for), so I created this repository. In the following weeks it bothered me more and more,\nthat if I had to fix a bug, it had to be done two times. Also both projects shared a similar API: again a lot of duplicate code.\n\nIn the last weeks I finally found some time to refactor vertx-jooq so it incorporates now both, the JDBC and the async driver.\n**Because of that, vertx-jooq-async will no longer be maintained.**\n\n\n\n# vertx-jooq-async\nThe _real_ async version of [vertx-jooq](https://github.com/jklingsporn/vertx-jooq): a [jOOQ](http://www.jooq.org/)-CodeGenerator to create [vertx](http://vertx.io/)-ified DAOs and POJOs!\nThis time with a [_real_ asynchronous driver](https://github.com/mauricio/postgresql-async). That's right - no JDBC.\n\n## differences to vertx-jooq\nThis project uses jOOQ for code-generation and to render queries. The query execution is done by the `AsyncJooqSQLClient`\nwhich wraps a `io.vertx.ext.asyncsql.AsyncSQLClient`. The `executeAsync`-method has been removed from `VertxDao`, instead\nyou need to call the `client()` method on the DAO to execute custom SQL-statements (see example below) on the `AsyncJooqSQLClient`.\n\n## example\n```\n//Setup your jOOQ configuration\nConfiguration configuration = new DefaultConfiguration();\nconfiguration.set(SQLDialect.MYSQL); //or SQLDialect.POSTGRES\n//no other DB-Configuration necessary because jOOQ is only used to render our statements - not for excecution\n\n//setup Vertx\nVertx vertx = Vertx.vertx();\n//setup the client\nJsonObject config = new JsonObject().put(\"host\", \"127.0.0.1\").put(\"username\", \"vertx\").putNull(\"password\").put(\"database\",\"vertx\");\nAsyncJooqSQLClient client = AsyncJooqSQLClient.create(vertx,MySQLClient.createNonShared(vertx, config))\n\n//instantiate a DAO (which is generated for you)\nSomethingDao dao = new SomethingDao(configuration);\ndao.setVertx(vertx);\ndao.setClient(client);\n\n//fetch something with ID 123...\nCompletableFuture\u003cVoid\u003e sendFuture =\n    dao.findByIdAsync(123).\n    thenAccept(something-\u003e\n        vertx.eventBus().send(\"sendSomething\",something.toJson())\n    );\n\n//maybe consume it in another verticle\nvertx.eventBus().\u003cJsonObject\u003econsumer(\"sendSomething\", jsonEvent-\u003e{\n    JsonObject message = jsonEvent.body();\n    //Convert it back into a POJO...\n    Something something = new Something(message);\n    //... change some values\n    something.setSomeregularnumber(456);\n    //... and update it into the DB\n    CompletableFuture\u003cVoid\u003e updatedFuture = dao.updateAsync(something);\n\n    //or do you prefer writing your own typesafe SQL?\n    CompletableFuture\u003cSomething\u003e selectFuture = dao.client().fetchOne(DSL.using(dao.configuration()).selectFrom(Tables.SOMETHING).orderBy(Tables.SOMETHING.SOMEID.desc()).limit(1),dao.jsonMapper());\n    //check for completion\n    selectFuture.whenComplete((something,ex)-\u003e{\n        if(ex==null){\n            System.out.println(\"It's something! \"+something.toJson());\n        }else{\n            System.err.println(\"Something failed badly: \"+ex.getMessage());\n        }\n    });\n});\n```\n\n# callback? future? rx?\nAgain, this library comes in different flavors:\n- the classic callback-handler style.\n- a API that returns a [vertx-ified implementation](https://github.com/cescoffier/vertx-completable-future)\nof `java.util.concurrent.CompletableFuture` for all async DAO operations and thus makes chaining your async operations easier.\nIt has some limitations which you need to be aware about (see [known issues](https://github.com/jklingsporn/vertx-jooq#known-issues)).\n- a RX Java based API\n\nDepending on your needs, you have to include one of the following dependencies into your pom:\n- [`vertx-jooq-async-classic`](https://github.com/jklingsporn/vertx-jooq/tree/master/vertx-jooq-async-classic) is the module containing the callback handler API.\n- [`vertx-jooq-async-future`](https://github.com/jklingsporn/vertx-jooq/tree/master/vertx-jooq-async-future) is the module containing the `CompletableFuture` based API.\n- [`vertx-jooq-async-rx`](https://github.com/jklingsporn/vertx-jooq/tree/master/vertx-jooq-async-rx) is the module containing the RX Java based API\n\n\n# maven\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eio.github.jklingsporn\u003c/groupId\u003e\n  \u003cartifactId\u003evertx-jooq-async-future\u003c/artifactId\u003e\n  \u003cversion\u003e0.4\u003c/version\u003e\n\u003c/dependency\u003e\n```\n# maven code generator configuration example for mysql\nThe following code-snippet can be copy-pasted into your pom.xml to generate code from your MySQL database schema.\n\n**Watch out for placeholders beginning with 'YOUR_xyz' though! E.g. you have to define credentials for DB access and specify the target directory where jOOQ\nshould put the generated code into, otherwise it won't run!**\n\nAfter you replaced all placeholders with valid values, you should be able to run `mvn generate-sources` which creates all POJOs and DAOs into the target directory you specified.\n\nIf you are new to jOOQ, I recommend to read the awesome [jOOQ documentation](http://www.jooq.org/doc/latest/manual/), especially the chapter about\n[code generation](http://www.jooq.org/doc/latest/manual/code-generation/).\n\n```\n\u003cproject\u003e\n...your project configuration here...\n\n  \u003cdependencies\u003e\n    ...your other dependencies...\n    \u003cdependency\u003e\n      \u003cgroupId\u003eorg.jooq\u003c/groupId\u003e\n      \u003cartifactId\u003ejooq\u003c/artifactId\u003e\n      \u003cversion\u003e3.9.2\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.github.jklingsporn\u003c/groupId\u003e\n      \u003cartifactId\u003evertx-jooq-async-future\u003c/artifactId\u003e\n      \u003cversion\u003e0.4\u003c/version\u003e\n    \u003c/dependency\u003e\n  \u003c/dependencies\u003e\n  \u003cbuild\u003e\n    \u003cplugins\u003e\n      \u003cplugin\u003e\n          \u003c!-- Specify the maven code generator plugin --\u003e\n          \u003cgroupId\u003eorg.jooq\u003c/groupId\u003e\n          \u003cartifactId\u003ejooq-codegen-maven\u003c/artifactId\u003e\n          \u003cversion\u003e3.9.2\u003c/version\u003e\n\n          \u003c!-- The plugin should hook into the generate goal --\u003e\n          \u003cexecutions\u003e\n              \u003cexecution\u003e\n                  \u003cgoals\u003e\n                      \u003cgoal\u003egenerate\u003c/goal\u003e\n                  \u003c/goals\u003e\n              \u003c/execution\u003e\n          \u003c/executions\u003e\n\n          \u003cdependencies\u003e\n              \u003cdependency\u003e\n                  \u003cgroupId\u003emysql\u003c/groupId\u003e\n                  \u003cartifactId\u003emysql-connector-java\u003c/artifactId\u003e\n                  \u003cversion\u003e5.1.37\u003c/version\u003e\n              \u003c/dependency\u003e\n              \u003cdependency\u003e\n                  \u003cgroupId\u003eio.github.jklingsporn\u003c/groupId\u003e\n                  \u003cartifactId\u003evertx-jooq-async-generate\u003c/artifactId\u003e\n                  \u003cversion\u003e0.4\u003c/version\u003e\n              \u003c/dependency\u003e\n          \u003c/dependencies\u003e\n\n          \u003c!-- Specify the plugin configuration.\n               The configuration format is the same as for the standalone code generator --\u003e\n          \u003cconfiguration\u003e\n              \u003c!-- JDBC connection parameters --\u003e\n              \u003cjdbc\u003e\n                  \u003cdriver\u003ecom.mysql.jdbc.Driver\u003c/driver\u003e\n                  \u003curl\u003eYOUR_JDBC_URL_HERE\u003c/url\u003e\n                  \u003cuser\u003eYOUR_DB_USER_HERE\u003c/user\u003e\n                  \u003cpassword\u003eYOUR_DB_PASSWORD_HERE\u003c/password\u003e\n              \u003c/jdbc\u003e\n\n              \u003c!-- Generator parameters --\u003e\n              \u003cgenerator\u003e\n                  \u003cname\u003eio.github.jklingsporn.vertx.jooq.async.generate.future.FutureAsyncVertxGenerator\u003c/name\u003e\n                  \u003cdatabase\u003e\n                      \u003cname\u003eorg.jooq.util.mysql.MySQLDatabase\u003c/name\u003e\n                      \u003cincludes\u003e.*\u003c/includes\u003e\n                      \u003cinputSchema\u003eYOUR_INPUT_SCHEMA\u003c/inputSchema\u003e\n                      \u003coutputSchema\u003eYOUR_OUTPUT_SCHEMA\u003c/outputSchema\u003e\n                      \u003cunsignedTypes\u003efalse\u003c/unsignedTypes\u003e\n                      \u003cforcedTypes\u003e\n                          \u003c!-- Convert tinyint to boolean --\u003e\n                          \u003cforcedType\u003e\n                              \u003cname\u003eBOOLEAN\u003c/name\u003e\n                              \u003ctypes\u003e(?i:TINYINT)\u003c/types\u003e\n                          \u003c/forcedType\u003e\n                          \u003c!-- Convert varchar column with name 'someJsonObject' to a io.vertx.core.json.JsonObject--\u003e\n                          \u003cforcedType\u003e\n                              \u003cuserType\u003eio.vertx.core.json.JsonObject\u003c/userType\u003e\n                              \u003cconverter\u003eio.github.jklingsporn.vertx.jooq.async.shared.JsonObjectConverter\u003c/converter\u003e\n                              \u003cexpression\u003esomeJsonObject\u003c/expression\u003e\n                              \u003ctypes\u003e.*\u003c/types\u003e\n                          \u003c/forcedType\u003e\n                          \u003c!-- Convert varchar column with name 'someJsonArray' to a io.vertx.core.json.JsonArray--\u003e\n                          \u003cforcedType\u003e\n                              \u003cuserType\u003eio.vertx.core.json.JsonArray\u003c/userType\u003e\n                              \u003cconverter\u003eJio.github.jklingsporn.vertx.jooq.async.shared.sonArrayConverter\u003c/converter\u003e\n                              \u003cexpression\u003esomeJsonArray\u003c/expression\u003e\n                              \u003ctypes\u003e.*\u003c/types\u003e\n                          \u003c/forcedType\u003e\n                      \u003c/forcedTypes\u003e\n                  \u003c/database\u003e\n                  \u003ctarget\u003e\n                      \u003c!-- This is where jOOQ will put your files --\u003e\n                      \u003cpackageName\u003eYOUR_TARGET_PACKAGE_HERE\u003c/packageName\u003e\n                      \u003cdirectory\u003eYOUR_TARGET_DIRECTORY_HERE\u003c/directory\u003e\n                  \u003c/target\u003e\n                  \u003cgenerate\u003e\n                      \u003cinterfaces\u003etrue\u003c/interfaces\u003e\n                      \u003cdaos\u003etrue\u003c/daos\u003e\n                      \u003cfluentSetters\u003etrue\u003c/fluentSetters\u003e\n                      \u003cpojosEqualsAndHashCode\u003etrue\u003c/pojosEqualsAndHashCode\u003e\n                  \u003c/generate\u003e\n\n\n                  \u003cstrategy\u003e\n                      \u003cname\u003eio.github.jklingsporn.vertx.jooq.async.generate.future.FutureAsyncGeneratorStrategy\u003c/name\u003e\n                  \u003c/strategy\u003e\n              \u003c/generator\u003e\n\n          \u003c/configuration\u003e\n      \u003c/plugin\u003e\n    \u003c/plugins\u003e\n  \u003c/build\u003e\n\u003c/project\u003e\n```\n# programmatic configuration of the code generator\nSee the [TestTool](https://github.com/jklingsporn/vertx-jooq-async/blob/master/vertx-jooq-async-generate/src/test/java/io/github/jklingsporn/vertx/jooq/async/generate/TestTool.java)\nof how to setup the generator programmatically.\n\n# known issues\n- `insertReturningPrimary`-method only works for MySQL and numeric keys.\n- Only available for MySQL and Postgres.\n- Nobody can prevent you from calling one of the blocking `fetch`- or `execute`-methods on the VertxDAO or a jOOQ-query. If you\ndo it, jOOQ will try to execute the query by itself using JDBC (if properly configured). So try to avoid it at any cost.\n- Currently no Guice support\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjklingsporn%2Fvertx-jooq-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjklingsporn%2Fvertx-jooq-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjklingsporn%2Fvertx-jooq-async/lists"}