{"id":15651457,"url":"https://github.com/rainbowdashlabs/sadu","last_synced_at":"2025-04-14T06:36:51.971Z","repository":{"id":56823044,"uuid":"525927044","full_name":"rainbowdashlabs/sadu","owner":"rainbowdashlabs","description":"Sql and damn utilitites. The successor of the sql-util.","archived":false,"fork":false,"pushed_at":"2025-04-11T15:12:18.000Z","size":3853,"stargazers_count":36,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T16:27:43.996Z","etag":null,"topics":["database","hacktoberfest","java","mariadb","mysql","postgresql","sql","sqlite","utility-library"],"latest_commit_sha":null,"homepage":"https://sadu.docs.chojo.dev/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rainbowdashlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2022-08-17T19:25:46.000Z","updated_at":"2024-12-30T22:27:14.000Z","dependencies_parsed_at":"2023-02-12T23:30:33.274Z","dependency_job_id":"314a7784-3cb4-4ba1-8a98-28ca3f3f6ba7","html_url":"https://github.com/rainbowdashlabs/sadu","commit_stats":{"total_commits":279,"total_committers":14,"mean_commits":"19.928571428571427","dds":"0.49820788530465954","last_synced_commit":"c0121ce8ef3e8d6512325db7fc3aee7f7eb0197a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainbowdashlabs%2Fsadu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainbowdashlabs%2Fsadu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainbowdashlabs%2Fsadu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainbowdashlabs%2Fsadu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rainbowdashlabs","download_url":"https://codeload.github.com/rainbowdashlabs/sadu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248835397,"owners_count":21169208,"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":["database","hacktoberfest","java","mariadb","mysql","postgresql","sql","sqlite","utility-library"],"created_at":"2024-10-03T12:38:36.594Z","updated_at":"2025-04-14T06:36:51.876Z","avatar_url":"https://github.com/rainbowdashlabs.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/rainbowdashlabs/sadu/publish.yml?style=for-the-badge\u0026label=Publishing\u0026branch=main)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/rainbowdashlabs/sadu/verify.yml?style=for-the-badge\u0026label=Building\u0026branch=main)\n\n[![Sonatype Nexus (Releases)](https://img.shields.io/maven-central/v/de.chojo.sadu/sadu?label=Release\u0026logo=Release\u0026style=for-the-badge)][nexus_releases]\n[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/de.chojo.sadu/sadu?server=https%3A%2F%2Fs01.oss.sonatype.org%2F\u0026style=for-the-badge\u0026label=Snapshot\u0026color=orange)][nexus_snapshots]\n\n### [Javadocs](https://rainbowdashlabs.github.io/sadu/)\n\n# SADU - Sql and damn utilitites\n\nThis project contains serveral things I use for working with sql.\n\nThe project is divided in several subprojects which allow to only import what you need.\n\nIt is by far not a replacement for large Frameworks like Hibernate, but a solid ground to reduce boilerplate code when\nyou work with plain SQL like I do most of the time.\n\n# Dependency\n\nIf you want to use all projects simply import the whole thing.\n\n```gradle\nimplementation(\"de.chojo.sadu\", \"sadu\", \"version\")\n```\n\n## Database dependencies\n\nSADU offers support for four different databases at the moment. To use them simply import:\n\n- `sadu-postgresql`\n- `sadu-mariadb`\n- `sadu-mysql`\n- `sadu-sqlite`\n\n## Querybuilder\n\nSADU offers a query builder to manage resources, error handling, result set reading and dispatching of queries.\n\nto use it import: `sadu-queries`\n\nLearn how to use the query builder [here](https://sadu.docs.chojo.dev/queries/)\n\n### But why should I use it?\n\nBefore I give you a long talk about how much nicer the syntax and code is let me simple show you a comparison.\n\nWithout the query builder your code would ideally look like this:\n\n```java\nclass MyQueries {\n\n    DataSource dataSource;\n\n    MyQueries(DataSource dataSource) {\n        this.dataSource = dataSource;\n    }\n\n    public CompletableFuture\u003cOptional\u003cResult\u003e\u003e getResultOld(int id) {\n        return CompletableFuture.supplyAsync(() -\u003e {\n            try (Connection conn = source().getConnection(); PreparedStatement stmt = conn.prepareStatement(\"SELECT result FROM results WHERE id = ?\")) {\n                stmt.setInt(id);\n                ResultSet rs = stmt.executeQuery();\n                if (rs.next()) {\n                    return Optional.of(new Result(rs.getString(\"result\")));\n                }\n            } catch (SQLException e) {\n                logger.error(\"Something went wrong\", e);\n            }\n            return Optional.empty();\n        });\n    }\n}\n```\n\nBut using the query builder your code becomes this:\n\n```java\nclass MyQueries {\n    public Optional\u003cResult\u003e getResultNew(int id) {\n        return Query.query(\"SELECT result FROM results WHERE id = ?\")\n                .single(Call.of().bind(id))\n                .map(row -\u003e new Result(rs.getString(\"result\")))\n                .first();\n    }\n}\n```\n\nBeautiful isnt it? The query builder will enforce try with resources, set parameters in the order defined by you,\nread the result set and additionally handle the exceptions for you.\n\n[How does it work?](https://sadu.docs.chojo.dev/queries/)\n\n## Datasource Builder\n\nSADU offsers a data source builder to create data sources for the databases listed above.\n\nto use it import: `sadu-datasource`\n\nNote that in order to use this, you need at least one of the listed databases from above.\n\nLearn how to use the datasource builder [here](https://sadu.docs.chojo.dev/data_source/)\n\n## Updater\n\nSADU offers a simple sql updater which deploys upgrade and migration scripts to your database.\n\nto use it import: `sadu-updater`\n\nLearn how to use it [here](https://sadu.docs.chojo.dev/updater/)\n\n\n[nexus_releases]: https://search.maven.org/search?q=de.chojo.sadu\n\n[nexus_snapshots]: https://s01.oss.sonatype.org/#nexus-search;quick~de.chojo.sadu\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainbowdashlabs%2Fsadu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frainbowdashlabs%2Fsadu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainbowdashlabs%2Fsadu/lists"}