{"id":18383139,"url":"https://github.com/fugerit-org/query-export-tool","last_synced_at":"2025-04-06T23:32:07.438Z","repository":{"id":55012408,"uuid":"190869474","full_name":"fugerit-org/query-export-tool","owner":"fugerit-org","description":"Tool export query in CSV and XLS / XLSX format","archived":false,"fork":false,"pushed_at":"2024-12-14T23:33:41.000Z","size":127,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T09:08:16.635Z","etag":null,"topics":["csv","export","query","tool","xls","xlsx"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fugerit-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2019-06-08T09:29:18.000Z","updated_at":"2024-12-14T23:33:32.000Z","dependencies_parsed_at":"2022-08-14T09:01:02.950Z","dependency_job_id":"e4551348-fe14-4740-91c1-01567ae1d27d","html_url":"https://github.com/fugerit-org/query-export-tool","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Fquery-export-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Fquery-export-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Fquery-export-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fugerit-org%2Fquery-export-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fugerit-org","download_url":"https://codeload.github.com/fugerit-org/query-export-tool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569124,"owners_count":20959758,"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":["csv","export","query","tool","xls","xlsx"],"created_at":"2024-11-06T01:10:12.086Z","updated_at":"2025-04-06T23:32:05.697Z","avatar_url":"https://github.com/fugerit-org.png","language":"Java","readme":"# query-export-tool\n\nTool export query in CSV and XLS / XLSX format\n\n[![Keep a Changelog v1.1.0 badge](https://img.shields.io/badge/changelog-Keep%20a%20Changelog%20v1.1.0-%23E05735)](CHANGELOG.md) \n[![Maven Central](https://img.shields.io/maven-central/v/org.fugerit.java/query-export-tool.svg)](https://mvnrepository.com/artifact/org.fugerit.java/query-export-tool)\n[![license](https://img.shields.io/badge/License-Apache%20License%202.0-teal.svg)](https://opensource.org/licenses/Apache-2.0)\n[![code of conduct](https://img.shields.io/badge/conduct-Contributor%20Covenant-purple.svg)](https://github.com/fugerit-org/fj-universe/blob/main/CODE_OF_CONDUCT.md)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_query-export-tool\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=fugerit-org_query-export-tool)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=fugerit-org_query-export-tool\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=fugerit-org_query-export-tool)\n\n![Java runtime version](https://img.shields.io/badge/run%20on-java%208+-%23113366.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)\n![Java build version](https://img.shields.io/badge/build%20on-java%2011+-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)\n![Apache Maven](https://img.shields.io/badge/Apache%20Maven-3.9.0+-C71A36?style=for-the-badge\u0026logo=Apache%20Maven\u0026logoColor=white)\n\n## 1 Quickstart\n\n### 1.1 Create a sample query catalog \n\n```\n\u003cquery-catalog-config\u003e\n\n\t\u003cquery-catalog id=\"main-catalog\"\u003e\n\t\t\u003cquery id=\"Q001\" sql=\"SELECT * FROM  test_export\" outputFormat=\"csv\" csvSeparator=\";\" outputFile=\"target/catalog_test_001.csv\"/\u003e\n\t\t\u003cquery id=\"Q002\" sql=\"SELECT * FROM  test_export\" outputFormat=\"csv\" outputFile=\"target/catalog_test_002.csv\"/\u003e\n\t\t\u003cquery id=\"Q003\" sql=\"SELECT * FROM  test_export\" outputFormat=\"html\" outputFile=\"target/catalog_test_003.html\" createPath=\"1\"/\u003e\n\t\t\u003cquery id=\"Q004\" sql=\"SELECT * FROM  test_export\" outputFormat=\"xls\" outputFile=\"target/catalog_test_004.xls\" xlsResize=\"1\" tryColumnType=\"1\"/\u003e\n\t\t\u003cquery id=\"Q005\" sql=\"SELECT * FROM  test_export\" outputFormat=\"xlsx\" outputFile=\"target/catalog_test_004.xlsx\" xlsTemplate=\"src/test/resources/template/test_template.xlsx\" /\u003e\n\t\u003c/query-catalog\u003e\n\n\u003c/query-catalog-config\u003e\n```\n\n### 1.2 Load and use the catalog\n\n```\n\t\tQueryConfigCatalog catalog = QueryConfigCatalog.loadQueryConfigCatalogSafe( \"cl://sample/query-catalog-sample.xml\" );\n\t\ttry ( Connection conn = ... ) {\n\t\t\tcatalog.handle( conn , \"main-catalog\", \"Q001\");\n\t\t}\n```\n\n## 2 Formats\n\n### 2.1 HTML format\n\nHTML format is handled with core I/O API, no dependency needed.\n\n### 2.2 CSV format\n\nCSV Format needs *OpenCSV* dependency, which is automatically included by default when importing query-export-tool dependency.\n\nIf needed it can be added in explicit way : \n\n```\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003ecom.opencsv\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003eopencsv\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e${opencsv-version}\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n```\n\n### 2.3 XLS/XLSX formats\n\nXLS/XLSX Formats needs *Apache POI* dependency, which is *NOT* automatically included by default when importing query-export-tool dependency : \n\n```\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003eorg.apache.poi\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003epoi-ooxml\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e${poi-version}\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n```\n\n## 3 Usage As SQL Catalog\n\nCreate the xml catalog : \n\n```xml\n\u003cquery-catalog-config bean-mode=\"bean-xml-full\"\u003e\n\n\t\u003cquery-catalog id=\"sample-catalog-alt\"\u003e\n\t\t\u003cquery id=\"Q001ALT\" outputFormat=\"csv\" csvSeparator=\";\" outputFile=\"target/catalog_test_001.csv\"\u003e\n\t\t\t\u003csql\u003eSELECT * FROM  test_export\u003c/sql\u003e\n\t\t\u003c/query\u003e\n\t\u003c/query-catalog\u003e\n\n\u003c/query-catalog-config\u003e\n```\n\nAccess the catalog : \n\n```java\nQueryConfigCatalog catalog = QueryConfigCatalog.loadQueryConfigCatalogSafe(\"cl://sample/query-catalog-sample-alt.xml\");\nQueryConfig queryConfig = catalog.getListMap( \"sample-catalog-alt\" ).get( \"Q001ALT\" );\nlogger.info( \"query config : {}, sql : {}\", queryConfig, queryConfig.getSql() );\n```\n\nA full example is available in the [JUNIT](src/test/java/test/org/fugerit/java/query/export/tool/TestCatalogAlt.java) .","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffugerit-org%2Fquery-export-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffugerit-org%2Fquery-export-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffugerit-org%2Fquery-export-tool/lists"}