{"id":28443129,"url":"https://github.com/hacihaciyev/jetquerious","last_synced_at":"2025-06-29T11:31:39.614Z","repository":{"id":291987505,"uuid":"970666340","full_name":"HaciHaciyev/JetQuerious","owner":"HaciHaciyev","description":"JetQuerious is a lightweight, high-performance, and developer-friendly library for working with JDBC and SQL in Java. Designed for simplicity and speed, it streamlines database access through clean, intuitive APIs while retaining full control over SQL execution. JetQuerious minimizes boilerplate, promotes safe and readable code","archived":false,"fork":false,"pushed_at":"2025-06-27T22:39:19.000Z","size":180,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T23:28:44.265Z","etag":null,"topics":["data","java","jdbc","jet-querious","persistance","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/HaciHaciyev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2025-04-22T11:01:09.000Z","updated_at":"2025-06-27T22:39:22.000Z","dependencies_parsed_at":"2025-05-07T15:34:36.500Z","dependency_job_id":"109ee9e3-1242-4607-bf65-530d424a10a7","html_url":"https://github.com/HaciHaciyev/JetQuerious","commit_stats":null,"previous_names":["hacihaciyev/jdbc-light","hacihaciyev/jetquerious"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/HaciHaciyev/JetQuerious","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaciHaciyev%2FJetQuerious","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaciHaciyev%2FJetQuerious/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaciHaciyev%2FJetQuerious/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaciHaciyev%2FJetQuerious/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HaciHaciyev","download_url":"https://codeload.github.com/HaciHaciyev/JetQuerious/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HaciHaciyev%2FJetQuerious/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262585900,"owners_count":23332742,"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":["data","java","jdbc","jet-querious","persistance","sql"],"created_at":"2025-06-06T06:41:15.884Z","updated_at":"2025-06-29T11:31:39.602Z","avatar_url":"https://github.com/HaciHaciyev.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JetQuerious – SQL that flies\n\nJetQuerious is a minimalistic persistence library for Java that makes SQL safe, expressive, and clean — without abstracting it away. \nIt’s not an ORM. It doesn’t generate queries for you. It doesn’t want to \"own\" your data layer.\nInstead, JetQuerious gives you just enough tools to write plain SQL with confidence, while keeping full control.\nIt reduces boilerplate, provides safe parameter handling,\nand integrates seamlessly with raw SQL – no ORM, no magic, just fast and flexible database access.\n\nAt the center of it all is the `JetQuerious` class — the main entry point and your primary companion for all database interactions. \nIt wraps JDBC in a functional, result-oriented API that handles connections, transactions, \nmapping, and errors — but leaves your logic and SQL untouched.\n\n---\n\n## Philosophy\n\nJetQuerious is built on the idea that most projects don’t need a heavy abstraction \nover SQL — they just need sane defaults and a few guardrails.\n\nWe don’t try to reinvent querying. We don't introduce a custom DSL. We don’t care about annotations or reflection.\nWe just want you to be able to:\n\n* Write SQL the way you already know it.\n* Handle results and errors cleanly.\n* Stop repeating yourself with resource management.\n* Compose DB logic in a predictable, testable way.\n\nIf you're looking for something to hide the database behind objects — you're in the wrong place. \nIf you want to write logic directly against SQL, and have a lightweight toolkit that helps you do that safely, welcome to JetQuerious.\n\n---\n\n## Core API: `JetQuerious`\n\nAll core features live in a single class: JetQuerious.\nThis is your gateway to querying, updating, inserting, building SQL statements, and wrapping code in transactions. \nYou get full control, without the noise.\n\nIn addition to basic read/write operations, JetQuerious integrates seamlessly \nwith QueryForge — a fluent utility for dynamically constructing SQL queries in a safe and composable way.\nIt helps reduce manual string concatenation, minimizes the risk of SQL injection, \nand makes complex query construction easier to maintain.\n\nHere’s what using it feels like:\n\n### Initialize the JetQuerious instance with a DataSource\n\nYou have to initialize the instance once. Then you can have this instance everywhere.\n\n```java\nDataSource dataSource = ...; // Obtain a DataSource instance\nJetQuerious.init(dataSource);\nJetQuerious jetQuerious = JetQuerious.instance();\n```\n\n### Fetching Data\n\nTo load a user by email:\n\n```java\nResult\u003cUserAccount, Throwable\u003e userResult = jetQuerious.read(\n        \"SELECT * FROM user_account\", \n        this::userAccountMapper,\n        email\n);\n\nUserAccount userAccountMapper(ResultSet rs) throws SQLException {\n    return new UserAccount(\n            rs.getLong(\"id\"),\n            rs.getString(\"email\"),\n            rs.getString(\"hashed_password\"),\n            rs.getTimestamp(\"created_at\").toInstant()\n    );\n}\n```\n\nIt’s that simple. No manual resource closing. No `try/catch` hell. Just `Result\u003cT\u003e` — success or failure, clearly separated.\nYoe need to write mapper only once\n\nFetching a list?\n\n```java\nimport static com.hadzhy.jetquerious.sql.QueryForge.*;\n\nString users = select()\n        .all()\n        .from(\"user_account\")\n        .build()\n        .sql();\n\nResult\u003cList\u003cUserAccount\u003e, Throwable\u003e result = jet.readListOf(users, this::userAccountMapper);\n\n// or you can use asynch version\n\nCompletableFuture\u003cResult\u003cList\u003cUserAccount\u003e, Throwable\u003e\u003e users = jet.asynchReadListOf(users, this::userAccountMapper);\n```\n\nNo need to pass a parameter setter if the query doesn’t have placeholders. JetQuerious makes both cases smooth.\n\n---\n\n### Writing Data\n\nTo insert a user:\n\n```java\nString saveUser = insert()\n        .into(\"user_account\")\n        .column(\"username\")\n        .column(\"email\")\n        .values()\n        .build()\n        .sql();\n\nResult\u003cBoolean, Throwable\u003e result = jet.write(saveUser, username, email);\n\n// or asynch version\n\nCompletableFuture\u003cResult\u003cBoolean, Throwable\u003e\u003e asynchResult = jet.asynchWrite(saveUser, username, email);\n```\n\n---\n\n### Transactions\n\nEvery method you call on JetQuerious is already transactional — each call is isolated, and auto-rolled back on failure.\n\nBut if you want to compose several steps inside a single transaction:\n\n```java\njetQuerious.transactional(conn -\u003e {\n    jetQuerious.stepInTransaction(conn, \"UPDATE accounts SET balance = balance - ? WHERE id = ?\", 100, 1);\n    jetQuerious.stepInTransaction(conn, \"UPDATE accounts SET balance = balance + ? WHERE id = ?\", 100, 2);\n});\n```\n\n---\n\n### Safe Results\n\nEvery operation in JetQuerious returns a `Result\u003cT\u003e`. No exceptions are thrown from your query methods — ever.\nYou always get one of two things:\n\n* `Result.success(value)`\n* `Result.failure(e)`\n\nYou handle both explicitly:\n\n```java\nif (result.isSuccess()) {\n    User user = result.value();\n} else {\n    log.warn(\"Failed to load user: {}\", result.error());\n}\n\nresult.ifSuccess(count -\u003e log.info(\"\"));\nresult.ifFailure(e -\u003e log.error(\"\"));\n\nUser user = result.orElseGet(new User(...));\n\n// Wrapping checked exception call\nResult\u003cString, Exception\u003e emailResult = Result.ofThrowable(() -\u003e\n        jet.readObjectOf(\"SELECT email FROM user_account WHERE id = ?\", String.class, id));\n```\n\nThis means fewer surprises, no hidden failures, and complete control over your error handling strategy.\n\n---\n\n## Not a Framework\n\nJetQuerious isn’t a framework. There’s no configuration. No magic context. No lifecycle. \nYou create an instance (backed by a `DataSource`) and you’re done.\n\nIt works just as well in a plain Java app, a Quarkus microservice, a Spring-based backend, or even a desktop tool. \nThe API is small and stable. The goal is long-term clarity, not short-term convenience.\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacihaciyev%2Fjetquerious","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhacihaciyev%2Fjetquerious","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacihaciyev%2Fjetquerious/lists"}