{"id":20349568,"url":"https://github.com/mineking9534/databaseutils","last_synced_at":"2026-02-17T02:03:49.945Z","repository":{"id":231374465,"uuid":"781628117","full_name":"MineKing9534/DatabaseUtils","owner":"MineKing9534","description":"Reflection driven database library for Java","archived":false,"fork":false,"pushed_at":"2024-10-29T20:10:05.000Z","size":111,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T04:04:03.048Z","etag":null,"topics":["database","java","postgres","reflection","sql"],"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/MineKing9534.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":"2024-04-03T18:35:38.000Z","updated_at":"2025-01-11T05:36:33.000Z","dependencies_parsed_at":"2024-06-05T10:45:05.031Z","dependency_job_id":"672c1126-edbf-4ec1-ac6b-2178e1147028","html_url":"https://github.com/MineKing9534/DatabaseUtils","commit_stats":null,"previous_names":["mineking9534/databaseutils"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/MineKing9534/DatabaseUtils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MineKing9534%2FDatabaseUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MineKing9534%2FDatabaseUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MineKing9534%2FDatabaseUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MineKing9534%2FDatabaseUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MineKing9534","download_url":"https://codeload.github.com/MineKing9534/DatabaseUtils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MineKing9534%2FDatabaseUtils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29530226,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T00:57:22.232Z","status":"online","status_checked_at":"2026-02-17T02:00:08.105Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","java","postgres","reflection","sql"],"created_at":"2024-11-14T22:26:29.293Z","updated_at":"2026-02-17T02:03:49.928Z","avatar_url":"https://github.com/MineKing9534.png","language":"Java","readme":"![[Java CI]](https://github.com/MineKing9534/DatabaseUtils/actions/workflows/check.yml/badge.svg)\n![[Latest Version]](https://maven.mineking.dev/api/badge/latest/releases/de/mineking/DatabaseUtils?prefix=v\u0026name=Latest%20Version\u0026color=0374b5)\n\n\u003e [!NOTE]  \n\u003e If you use Kotlin it is highly recommended to use [KORMite](https://github.com/MineKing9534/KORMite) instead. It is a kotlin rewrite of this library with more features, more stability and a cleaner API interface.\n\n# Installation\n\nDatabaseUtils is hosted on a custom repository at [https://maven.mineking.dev](https://maven.mineking.dev/#/releases/de/mineking/DatabaseUtils). Replace VERSION with the lastest version (without the `v` prefix).\nAlternatively, you can download the artifacts from jitpack (not recommended).\n\n### Gradle\n\n```groovy\nrepositories {\n    maven { url \"https://maven.mineking.dev/releases\" }\n}\n\ndependencies {\n    implementation \"de.mineking:DatabaseUtils:VERSION\"\n}\n```\n\n### Maven\n\n```xml\n\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003emineking\u003c/id\u003e\n        \u003curl\u003ehttps://maven.mineking.dev/releases\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ede.mineking\u003c/groupId\u003e\n        \u003cartifactId\u003eDatabaseUtils\u003c/artifactId\u003e\n        \u003cversion\u003eVERSION\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n## Usage\n### Example 1\n\n```java\npublic class User {\n  @Column(key = true)\n  public ID id; //You can use the JavaUtils ID class as column. It will automatically be generated. For custom types see TypeMapper and DatabaseManager#addMapper\n\n  @Column\n  public String name;\n\n  @Column\n  public String email;\n\n  public User() {}\n\n  public User(String name, String email) {\n    this.name = name;\n    this.email = email;\n  }\n}\n\npublic class Main {\n  public static void main(String[] args) {\n    DatabaseManager manager = new DatabaseManager(\"localhost:5432/test\", \"user\", \"password\");\n    Table\u003cUser\u003e table = manager.getTable(User.class, User::new, \"users\");\n\n    var user = new User(\"Rick Astley\", \"rick@example.com\");\n    table.insert(user);\n    System.out.println(user.id.asString()); //The id has been generated automatically\n  }\n}\n```\n\n### Example 2\n\n```java\npublic class Book implements DataClass\u003cBook\u003e {\n  @Column(autoincrement = true, key = true)\n  public int id;\n\n  @Column\n  public String title;\n\n  @Column\n  public String author;\n\n  private final Table\u003cBook\u003e table;\n\n  public Book(Table\u003cBook\u003e table) {}\n\n  public Book(Table\u003cBook\u003e table, String title, String author) {\n    this.title = title;\n    this.author = author;\n    this.table = table;\n  }\n\n  @Override\n  public String toString() {\n    return id + \": \" + title + \" by \" + author;\n  }\n}\n\npublic class Main {\n  public final DatabaseManager manager;\n  public final Table\u003cBook\u003e table;\n\n  public static void main(String[] args) {\n    new Main();\n  }\n\n  public Main() {\n    manager = new DatabaseManager(\"localhost:5432/test\", \"user\", \"password\");\n    table = manager.getTable(Book.class, this::createInstance, \"books\");\n\n    System.out.println(new Book(table, \"My Life\", \"Rick Astley\").update());\n    System.out.println(table.selectAll(Order.ascendingBy(\"id\").limit(5)));\n\n    table.selectMany(Where.greateOrEqual(\"id\", 3)).forEach(Book::delete);\n  }\n\n  private Book createInstance() {\n    return new Book(table);\n  }\n}\n```\n\n### Example 3\n\n```java\npublic interface Bookshelf extends Table\u003cBook\u003e { //You can create custom tables\n  default List\u003cBook\u003e getByAuthor(String author) {\n    return selectMany(Where.equals(\"author\", author));\n  }\n}\n\npublic class Main {\n  public static void main(String[] args) {\n    DatabaseManager manager = new DatabaseManager(\"localhost:5432/test\", \"user\", \"password\");\n    Bookshelf table = manager.getTable(Bookshelf.class, User.class, User::new, \"books\");\n\n    System.out.println(table.getByAuthor(\"Rick Astley\"));\n  }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmineking9534%2Fdatabaseutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmineking9534%2Fdatabaseutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmineking9534%2Fdatabaseutils/lists"}