{"id":25515234,"url":"https://github.com/tharos70/jdbc-swiss-knife","last_synced_at":"2026-04-28T23:34:13.748Z","repository":{"id":57740943,"uuid":"367421350","full_name":"tharos70/jdbc-swiss-knife","owner":"tharos70","description":"A simple set of utilities for handling jdbc accessible metadata.","archived":false,"fork":false,"pushed_at":"2021-08-07T15:25:50.000Z","size":138,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-16T03:13:51.296Z","etag":null,"topics":["dao","generator","java","jdbc","postgresql"],"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/tharos70.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":"2021-05-14T16:31:17.000Z","updated_at":"2021-08-07T15:25:52.000Z","dependencies_parsed_at":"2022-09-06T23:30:52.954Z","dependency_job_id":null,"html_url":"https://github.com/tharos70/jdbc-swiss-knife","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/tharos70%2Fjdbc-swiss-knife","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharos70%2Fjdbc-swiss-knife/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharos70%2Fjdbc-swiss-knife/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tharos70%2Fjdbc-swiss-knife/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tharos70","download_url":"https://codeload.github.com/tharos70/jdbc-swiss-knife/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239662747,"owners_count":19676435,"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":["dao","generator","java","jdbc","postgresql"],"created_at":"2025-02-19T13:19:40.612Z","updated_at":"2025-12-07T10:30:31.303Z","avatar_url":"https://github.com/tharos70.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/tharos70/jdbc-swiss-knife.svg?token=kbKF5Pe78YjqptYzcmBk\u0026branch=main)](https://travis-ci.com/tharos70/jdbc-swiss-knife)\r\n\r\n![logo](/assets/img/logo.png)\r\n\r\n# jdbc-swiss-knife\r\n\u003e A simple set of utilities for handling jdbc accessible metadata. \r\n\r\nIt includes:\r\n - Database metadata reader\r\n - Database metadata based java code generator supporting:\r\n   - spring-jdbc Dao basic implementation\r\n   \r\n\u003e So far, the only supported database is [Posgresql](https://www.postgresql.org/). Anyway, it should be easy to extend the support to other jdbc compliant platforms\r\n\r\n## Installing / Getting started\r\n\r\nSimply add the following dependency to you `pom.xml`\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n  \u003cgroupId\u003ecom.tharos\u003c/groupId\u003e\r\n  \u003cartifactId\u003ejdbc-swiss-knife\u003c/artifactId\u003e\r\n  \u003cversion\u003e${version}\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n## How to\r\n\r\n### - Read metadata from DB\r\n\r\n```java\r\nDatabaseMetadataExtractor dbme = new DatabaseMetadataExtractor(\r\n      \"org.postgresql.Driver\",\r\n      \"jdbc:postgresql://localhost:5432/postgres\",\r\n      \"user\",\r\n      \"password\",\r\n      \"schema-name\"\r\n    );\r\n//Retrieves all tables in schema    \r\nArrayList\u003cTable\u003e tableList = dbme.getTablesList(); \r\n....\r\n//Retrieves all columns for tableName    \r\nArrayList\u003cColumn\u003e columnList = dbme.extractColumnsInfo(\"tableName\");\r\n```\r\n\r\n### - Generate spring-jdbc framework based Dao Classes\r\n\r\n```java\r\n...\r\nTable t = dbme.getTablesList().get(0);\r\nnew DaoPatternStrategy()\r\n      .generate(\r\n          t,\r\n          \"base.package\", // base package for generated classes\r\n          new File(\"/path/to/output/folder\")\r\n        );\r\n```\r\n\r\n### - Generate spring-jdbc framework based configuration\r\n\r\n```java\r\n...\r\nList\u003cTable\u003e tableList = dbme.getTablesList();\r\nnew SpringConfigurationGenerator(\r\n        tableList,\r\n        \"base.package\",\r\n        new File(\"/path/to/output/folder\")\r\n      ).generate();\r\n```\r\n\r\n## Developing\r\n\r\nIf you want to extend this library just run the following command\r\n\r\n```shell\r\ngit clone https://github.com/tharos70/jdbc-swiss-knife.git\r\n```\r\n\r\n### Building\r\n\r\nIn order to build the project just install [maven](https://maven.apache.org/) and a java 11 compatible sdk (such as [adoptOpenJdk](https://adoptopenjdk.net/)) in your system and run the following command\r\n\r\n```shell\r\ncd jdbc-swiss-knife\r\nmvn clean install\r\n```\r\n\r\nNow you can add you own functionality to the library with your favourite IDE.\r\n\r\n## Contributing\r\n\r\nIf you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.\r\n\r\n## Links\r\n\r\n- Project homepage: https://github.com/tharos70/jdbc-swiss-knife\r\n- Repository: https://github.com/tharos70/jdbc-swiss-knife\r\n- Issue tracker: https://github.com/tharos70/jdbc-swiss-knife/issues\r\n  - In case of sensitive bugs like security vulnerabilities, please contact\r\n    tharos70@gmail.com directly instead of using issue tracker. We value your effort to improve the security and privacy of this project!\r\n- Related projects:\r\n  \r\n\u003e This project relies on the amazing [Javapoet](https://github.com/square/javapoet) library. A huge thanks to *square* for creating such an amazing tool.\r\n\r\n## Project status\r\n\r\nThis project is considered *under construction* so use it carefully and at your own risk.\r\n\r\n## Licensing\r\n\r\nAll the code in this project is licensed under Apache License 2.0 license.\r\n\r\n## Publishing\r\n\r\nhttps://s01.oss.sonatype.org/#stagingRepositories\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftharos70%2Fjdbc-swiss-knife","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftharos70%2Fjdbc-swiss-knife","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftharos70%2Fjdbc-swiss-knife/lists"}