{"id":21490096,"url":"https://github.com/mefrreex/jooqconnector","last_synced_at":"2025-07-25T01:16:48.438Z","repository":{"id":235179025,"uuid":"790120070","full_name":"MEFRREEX/JOOQConnector","owner":"MEFRREEX","description":"A library for working with databases using JOOQ ORM for Java","archived":false,"fork":false,"pushed_at":"2024-10-04T23:56:48.000Z","size":102,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T23:22:09.310Z","etag":null,"topics":["database","mysql","sqlite","sqlite3"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MEFRREEX.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-22T09:52:19.000Z","updated_at":"2024-12-14T19:49:04.000Z","dependencies_parsed_at":"2024-11-23T14:43:41.669Z","dependency_job_id":null,"html_url":"https://github.com/MEFRREEX/JOOQConnector","commit_stats":null,"previous_names":["mefrreex/jooqconnector"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FJOOQConnector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FJOOQConnector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FJOOQConnector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MEFRREEX%2FJOOQConnector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MEFRREEX","download_url":"https://codeload.github.com/MEFRREEX/JOOQConnector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250414644,"owners_count":21426626,"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","mysql","sqlite","sqlite3"],"created_at":"2024-11-23T14:30:42.456Z","updated_at":"2025-04-23T10:26:26.615Z","avatar_url":"https://github.com/MEFRREEX.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JOOQConnector\nA library for working with databases using JOOQ ORM for Java.\n\n[![License: GNU GPLv3](https://img.shields.io/badge/License-GNU%20GPLv3-yellow)](LICENSE)\n[![Version](https://img.shields.io/badge/Version-1.0.1-brightgreen)](https://github.com/MEFRREEX/JOOQConnector/releases/tag/1.0.1)\n[![Jitpack](https://jitpack.io/v/MEFRREEX/JOOQConnector.svg)](https://jitpack.io/#MEFRREEX/JOOQConnector)\n\n## 📖 Overview\n**JOOQConnector** is a Java library designed for easy interaction with databases using the JOOQ ORM. It includes built-in support for SQLite and MySQL databases and is designed to work with various server software like Bukkit, Nukkit, PowerNukkitX, JukeboxMC, and WaterdogPE.\n\n### ✨ Features\n- **SQLite3 and MySQL Support**: Seamless integration with SQLite and MySQL databases.\n- **No Unnecessary Logs**: Disable JOOQ logo and tips from appearing in the logs.\n- **Bundled Drivers**: Includes SQLite, and MySQL drivers in the JAR.\n- **Cross-Platform Support**: Compatible with different Minecraft server software.\n\n## 🛠 Code Examples\n\n### Disable JOOQ Logs\nYou can disable the printing of the JOOQ logo and tips:\n```java\nJOOQConnector.setJOOQMessagesEnabled(false);\n```\n\n### SQLite3 Example\n```java\nTable\u003c?\u003e table = DSL.table(\"test\");\nSQLiteDatabase database = new SQLiteDatabase(new File(\"database.db\"));\n\n// Creating table\ndatabase.getConnection().thenAcceptAsync(connection -\u003e {\n    DSL.using(connection)\n            .createTableIfNotExists(table)\n            .column(\"id\", SQLDataType.INTEGER)\n            .column(\"data\", SQLDataType.VARCHAR)\n            .unique(\"id\")\n            .execute();\n}).join();\n\n// Inserting value into the table\ndatabase.getConnection().thenAcceptAsync(connection -\u003e {\n    DSL.using(connection).insertInto(table)\n            .set(DSL.field(\"id\"), 1)\n            .set(DSL.field(\"data\"), \"Test string\")\n            .execute();\n}).join();\n\n// Getting value from the table\nString value = database.getConnection().thenApplyAsync(connection -\u003e {\n    Result\u003cRecord\u003e result = DSL.using(connection).select()\n            .from(table)\n            .where(DSL.field(\"id\").eq(1))\n            .fetch();\n    return result.isEmpty() ? null : result.get(0).get(DSL.field(\"data\", String.class));\n}).join();\n\nSystem.out.println(\"Value from table: \" + value);\n```\n\n### MySQL Example\n```java\nMySQLDatabase database = new MySQLDatabase(\"127.0.0.1:3306\", \"database\", \"user\", \"password\");\n\n// The rest of the code is identical to the SQLite example...\n```\n\n### Switching Between SQLite and MySQL\n```java\nIDatabase database = sqlite ? \n    new SQLiteDatabase(new File(\"database.db\")) : \n    new MySQLDatabase(\"127.0.0.1:3306\", \"database\", \"user\", \"password\");\n```\n\n### Organizing Database Operations in a Class\n```java\npublic class Database {\n\n    private final IDatabase database;\n    private final Table\u003c?\u003e table;\n\n    public Database(IDatabase database, Table\u003c?\u003e table) {\n        this.database = database;\n        this.table = table;\n\n        database.getConnection().thenAcceptAsync(connection -\u003e {\n            DSL.using(connection)\n                    .createTableIfNotExists(table)\n                    .column(\"id\", SQLDataType.INTEGER)\n                    .column(\"data\", SQLDataType.VARCHAR)\n                    .unique(\"id\")\n                    .execute();\n        }).join();\n    }\n\n    public CompletableFuture\u003cVoid\u003e addValue(int id, String data) {\n        return database.getConnection().thenAcceptAsync(connection -\u003e {\n            DSL.using(connection).insertInto(table)\n                    .set(DSL.field(\"id\"), id)\n                    .set(DSL.field(\"data\"), data)\n                    .execute();\n        });\n    }\n\n    public CompletableFuture\u003cString\u003e getValue(int id) {\n        return database.getConnection().thenApplyAsync(connection -\u003e {\n            Result\u003cRecord\u003e result = DSL.using(connection).select()\n                    .from(table)\n                    .where(DSL.field(\"id\").eq(id))\n                    .fetch();\n\n            return result.isEmpty() ? null : result.get(0).get(DSL.field(\"data\", String.class));\n        });\n    }\n}\n```\n\n## 🔌 Installation\n\n### Plugin Setup\nIf you're not using the standalone API version, place the plugin JAR in your server's `plugins` folder.\n\n### Maven\nAdd the following repository and dependency to your `pom.xml`:\n\n```xml\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.MEFRREEX\u003c/groupId\u003e\n    \u003cartifactId\u003eJOOQConnector\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.1\u003c/version\u003e\n    \u003cscope\u003eprovided\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n### Gradle\nAdd the following repository and dependency to your `build.gradle`:\n\n```groovy\nrepositories {\n    mavenCentral()\n    maven { url 'https://jitpack.io' }\n}\n\ndependencies {\n    implementation 'com.github.MEFRREEX:JOOQConnector:1.0.1'\n}\n```\n\n___\n\n[Switch to Russian](README_ru.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefrreex%2Fjooqconnector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmefrreex%2Fjooqconnector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmefrreex%2Fjooqconnector/lists"}