{"id":13758225,"url":"https://github.com/jklingsporn/vertx-jooq","last_synced_at":"2025-04-13T00:47:45.664Z","repository":{"id":37286310,"uuid":"72728706","full_name":"jklingsporn/vertx-jooq","owner":"jklingsporn","description":"A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.","archived":false,"fork":false,"pushed_at":"2024-01-11T11:28:15.000Z","size":3023,"stargazers_count":386,"open_issues_count":45,"forks_count":54,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-13T00:47:37.984Z","etag":null,"topics":["java","jdbc","jooq","reactive","rxjava2","rxjava3","vertx","vertx-jooq"],"latest_commit_sha":null,"homepage":"","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-03T09:21:43.000Z","updated_at":"2025-04-04T01:54:47.000Z","dependencies_parsed_at":"2024-01-03T02:25:01.712Z","dependency_job_id":"63b97c6b-d13c-4820-aa44-91bd495a6d17","html_url":"https://github.com/jklingsporn/vertx-jooq","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklingsporn%2Fvertx-jooq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jklingsporn","download_url":"https://codeload.github.com/jklingsporn/vertx-jooq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650435,"owners_count":21139672,"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","jdbc","jooq","reactive","rxjava2","rxjava3","vertx","vertx-jooq"],"created_at":"2024-08-03T13:00:19.757Z","updated_at":"2025-04-13T00:47:45.645Z","avatar_url":"https://github.com/jklingsporn.png","language":"Java","funding_links":[],"categories":["Database Clients","Back-End Development","数据库开发"],"sub_categories":["[Vert.x](https://github.com/vert-x3/vertx-awesome)","语音合成"],"readme":"# vertx-jooq\nA [jOOQ](http://www.jooq.org/)-CodeGenerator to create [vertx](http://vertx.io/)-ified DAOs and POJOs!\nPerform all CRUD-operations asynchronously and convert your POJOs from/into a `io.vertx.core.json.JsonObject` using the API and\ndriver of your choice.\n\n## latest release 6.5.5\n\n- Fix Use enum literal instead of toString for datatype conversion [#209](https://github.com/jklingsporn/vertx-jooq/issues/209)\n- Update to jooq 3.17.3\n- Update to vertx 4.3.3\n- Update mutiny dependencies\n- Update rx dependencies\n\n\n## different needs, different apis\n![What do you want](https://media.giphy.com/media/E87jjnSCANThe/giphy.gif)\n\nBefore you start generating code using vertx-jooq, you have to answer these questions:\n- **Which API do you want to use?**\n  - a `io.vertx.core.Future`-based API. This is `vertx-jooq-classic`.\n  - a [rxjava2](https://github.com/ReactiveX/RxJava/tree/2.x) based API. This is `vertx-jooq-rx`.\n  - a [rxjava3](https://github.com/ReactiveX/RxJava) based API. This is `vertx-jooq-rx3`.\n  - a [mutiny](https://smallrye.io/smallrye-mutiny/) based API. This is `vertx-jooq-mutiny`.\n- **How do you want to communicate with the database?**\n  - Using good old JDBC, check for the modules with `-jdbc` suffix.\n  - Using the [reactive vertx](https://github.com/eclipse-vertx/vertx-sql-client) database driver, check for `-reactive` modules.\n- **Do you need extras?**\n  - Support for [Guice](https://github.com/google/guice) dependency injection\n  - Generation of `io.vertx.codegen.annotations.@DataObject`-annotations for your POJOs\n  \n\nOnce you made your choice, you can start to configure the code-generator. This can be either done programmatically or\n using a maven- / gradle-plugin (recommended way). \nPlease check the documentation in the module of the API and driver of your choice how to set it up and how to use it:\n\n- [`vertx-jooq-classic-jdbc`](vertx-jooq-classic-jdbc)\n- [`vertx-jooq-classic-reactive`](vertx-jooq-classic-reactive)\n- [`vertx-jooq-rx-jdbc`](vertx-jooq-rx-jdbc)\n- [`vertx-jooq-rx-reactive`](vertx-jooq-rx-reactive)\n- [`vertx-jooq-rx3-jdbc`](vertx-jooq-rx3-jdbc)\n- [`vertx-jooq-rx3-reactive`](vertx-jooq-rx3-reactive)\n- [`vertx-jooq-mutiny-jdbc`](vertx-jooq-mutiny-jdbc)\n- [`vertx-jooq-mutiny-reactive`](vertx-jooq-mutiny-reactive)\n\n## example\nOnce the generator is set up, it can create DAOs like in the code snippet below (classic-API, JDBC, no dependency injection):\n```java\n//Setup your jOOQ configuration\nConfiguration configuration = ...\n\n//setup Vertx\nVertx vertx = Vertx.vertx();\n\n//instantiate a DAO (which is generated for you)\nSomethingDao dao = new SomethingDao(configuration,vertx);\n\n//fetch something with ID 123...\ndao.findOneById(123)\n    .onComplete(res-\u003e{\n    \t\tif(res.succeeded()){\n        \t\tvertx.eventBus().send(\"sendSomething\", res.result().toJson())\n    \t\t}else{\n    \t\t\t\tSystem.err.println(\"Something failed badly: \"+res.cause().getMessage());\n    \t\t}\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    Future\u003cInteger\u003e updatedFuture = dao.update(something);\n});\n\n//or do you prefer writing your own type-safe SQL? Use the QueryExecutor from the DAO...\nClassicQueryExecutor queryExecutor = dao.queryExecutor();\n//... or create a new one when there is no DAO around :)\nqueryExecutor = new JDBCClassicGenericQueryExecutor(configuration,vertx);\nFuture\u003cInteger\u003e updatedCustom = queryExecutor.execute(dslContext -\u003e\n\t\t\t\tdslContext\n\t\t\t\t.update(Tables.SOMETHING)\n\t\t\t\t.set(Tables.SOMETHING.SOMEREGULARNUMBER,456)\n\t\t\t\t.where(Tables.SOMETHING.SOMEID.eq(something.getSomeid()))\n\t\t\t\t.execute()\n);\n\n//check for completion\nupdatedCustom.onComplete(res-\u003e{\n\t\tif(res.succeeded()){\n\t\t\t\tSystem.out.println(\"Rows updated: \"+res.result());\n\t\t}else{\n\t\t\t\tSystem.err.println(\"Something failed badly: \"+res.cause().getMessage());\n\t\t}\n});\n```\nMore examples can be found [here](https://github.com/jklingsporn/vertx-jooq/blob/master/vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate/classic/ClassicTestBase.java), [here](https://github.com/jklingsporn/vertx-jooq/blob/master/vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate/rx3/RX3TestBase.java) and [here](https://github.com/jklingsporn/vertx-jooq/blob/master/vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate/mutiny/MutinyTestBase.java).\n\n# FAQ\n## vertx is cool, but what about quarkus?\nCheckout [this repository](https://github.com/jklingsporn/quarkus-jooq-reactive-example) to figure out how to utilize vertx-jooq to create Quarkus-compatible classes.\n\n## handling custom datatypes\nThe generator will omit datatypes that it does not know, e.g. `java.sql.Timestamp`. To fix this, you can subclass the generator, handle these types and generate the code using your generator.\n See the `handleCustomTypeFromJson` and `handleCustomTypeToJson` methods in the `AbstractVertxGenerator` or checkout the [`CustomVertxGenerator`](vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate/custom)\n from the tests.\n \n## is vertx-jooq compatible with Java 8? \nStarting with version `6.4.0`, vertx-jooq implicitly requires Java 11, as this is the minimum required version by the non-commercial version of jOOQ `3.15`. \nIf you're stuck with Java 8, the latest version you can use is `6.3.0`. \n\n## are you sure this works?\nYes! There are [many integration tests](https://github.com/jklingsporn/vertx-jooq/tree/master/vertx-jooq-generate/src/test/java/io/github/jklingsporn/vertx/jooq/generate) that cover most usecases. \nCheck them out if you're interested.\n### how to run tests\nThe tests are executed against two docker containers. Please refer to [this readme](docker/README.md) of how to set them up.\n#### I receive a \"Too many open files\" exception on **macOS**\nIncrease your file limits. Unfortunately the solution differs by each OS version, so you have to do some research.\n\n\n# disclaimer\nThis library comes without any warranty - just take it or leave it. Also, the author is neither connected to the\ncompany behind vertx nor the one behind jOOQ.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjklingsporn%2Fvertx-jooq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjklingsporn%2Fvertx-jooq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjklingsporn%2Fvertx-jooq/lists"}