{"id":18688749,"url":"https://github.com/miniconnect/miniconnect","last_synced_at":"2025-04-12T05:38:19.803Z","repository":{"id":45689183,"uuid":"324093353","full_name":"miniconnect/miniconnect","owner":"miniconnect","description":"Minimalistic DB connector framework and JDBC bridge","archived":false,"fork":false,"pushed_at":"2025-03-28T00:09:57.000Z","size":1903,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T05:38:09.954Z","etag":null,"topics":["api","database-access-library","java","jdbc-driver","minimalistic","sql-runner"],"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/miniconnect.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-12-24T07:20:10.000Z","updated_at":"2025-03-15T21:34:40.000Z","dependencies_parsed_at":"2023-12-24T07:12:35.005Z","dependency_job_id":"2fa58fbb-5a59-45bf-a6cc-0fd47ac25a5d","html_url":"https://github.com/miniconnect/miniconnect","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miniconnect%2Fminiconnect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miniconnect%2Fminiconnect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miniconnect%2Fminiconnect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miniconnect%2Fminiconnect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miniconnect","download_url":"https://codeload.github.com/miniconnect/miniconnect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525168,"owners_count":21118616,"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":["api","database-access-library","java","jdbc-driver","minimalistic","sql-runner"],"created_at":"2024-11-07T10:38:07.164Z","updated_at":"2025-04-12T05:38:19.784Z","avatar_url":"https://github.com/miniconnect.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MiniConnect\n\nMinimalistic database API and JDBC bridge.\n\n## Overview of sub-projects\n\nMiniConnect consists of several separated components:\n\n| Subproject | Description |\n| ---------- | ----------- |\n| :minidisc: `impl` | Obvious implementations of some api pieces |\n| :old_key: `jdbc` | JDBC driver backed by MiniConnect |\n| :electric_plug: `jdbc-adapter` | MiniConnect implementation backed by JDBC |\n| :envelope: `messenger` | Default solution for messaging with message definitions |\n| :fast_forward: `record` | Easy-to-use wrapper for result sets |\n| :postbox: `rest` | Simple REST service for MiniConnect |\n| :desktop_computer: `server` | Lightweight and transparent MiniConnect server and client |\n| :truck: `transfer` | Simple networking framework |\n| :hammer_and_wrench: `util` | Common utilities |\n\nThese gradle sub-projects can be found in the projects directory.\n\n## Getting started with the API\n\nThe biggest advantage of API decoupling is that\nit makes it very easy to create transparent components\n(proxies, loggers, mocks, and other wrappers),\nall that's needed is a fairly stable dependency.\n\nHere is a minimal example:\n\n```java\ntry (MiniSession session = connectionFactory.connect()) {\n    MiniResult result = session.execute(\"SELECT name FROM employees\");\n    try (MiniResultSet resultSet = result.resultSet()) {\n        ImmutableList\u003cMiniValue\u003e row;\n        while ((row = resultSet.fetch()) != null) {\n            String name = row.get(0).contentAccess().get().toString();\n            System.out.println(\"name: \" + name);\n        }\n    }\n}\n```\n\nSee [MiniConnect API](https://github.com/miniconnect/miniconnect-api) for more information.\n\n## Friendly result sets with the `record` project\n\nThe `record` project provides a higher level easy-to-use wrapper over `MiniResultSet`.\n`ResultTable` is iterable, can convert values, etc.\n\nThis is the `ResultTable` version of the example above, extended with retrieving the id as an integer:\n\n```java\ntry (MiniSession session = connectionFactory.connect()) {\n    MiniResult result = session.execute(\"SELECT id, name FROM employees\");\n    try (MiniResultSet resultSet = result.resultSet()) {\n        for (ResultRecord row : new ResultTable(resultSet)) {\n            int id = row.get(0).as(Integer.class);\n            String name = row.get(1).as(String.class);\n            System.out.println(\"id: \" + id + \", name: \" + name);\n        }\n    }\n}\n```\n\n## No prepared statements?\n\nFollowing the logic of the above approach, on the client side, there is no place for a `prepare()` method in the API.\nIf you want to take advantage of the performance and security gains of prepared queries,\nyou should do so via the `PREPARE FROM` query.\nThere's no point in sparing even the parsing of an `EXECUTE` query.\n\nIn the `jdbc` project there are some helper `PreparedStatement` providers\nfor RDBMS backends that do not support `PREPARE FROM` queries.\nOne of these implementations emulates the execution of prepared queries by using user variables (default)\nand another by manipulating the query.\nAlternatively, as a last resort, you can easily implement `PREPARE FROM` and `EXECUTE` on the server side.\n\n## Database engines\n\nThe simple session API makes it easy to make a connector to any custom database.\n\nThe `rdbms-framework` sub-project provides a framework for implementing\na MiniConnect driver (or even a complete database engine).\n\n[HoloDB](https://github.com/miniconnect/holodb) is a storage engine for `rdbms-framework`.\nIt requires only a configuration file and provides an arbitrarily large database filled with random data.\n\n## JDBC compatibility\n\n*Note: one of the major goals of MiniConnect is to relieve the pains of JDBC users and implementors.*\n**\n\nThere are built-in JDBC-\u003eMiniConnect and MiniConnect-\u003eJDBC bridges,\nso any tool that understands JDBC (e. g. Hibernate) can use your MiniConnect driver,\nand vice versa: any JDBC connection can be used via MiniConnect.\n\nUsing a MiniConnect session via JDBC:\n\n```java\nConnection connection = new MiniJdbcConnection(miniSession, provider);\n```\n\nUsing a JDBC connection via MiniConnect:\n\n```java\nMiniSession session = new JdbcAdapterSession(connection, largeDataPutter);\n```\n\nThe `jdbc` project provides an SPI service implementation for `java.sql.Driver`.\nYou can use the following JDBC URL syntax to connect a MiniConnect server:\n\n```\njdbc:miniconnect://\u003chost\u003e:\u003cport\u003e/[\u003cschema\u003e[?\u003ckey1\u003e=\u003cvalue1\u003e[\u0026\u003ckeyN\u003e=\u003cvalueN\u003e]+]]\n```\n\nFor example:\n\n```\njdbc:miniconnect://localhost:3430/economy\n```\n\nThe default port is `3430`.\n\nAlso, there is an SPI service implementation for Hibernate's `org.hibernate.boot.spi.MetadataBuilderInitializer`.\nSo any MiniConnect server or session factory can be used with Hibernate without complicated configuration.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminiconnect%2Fminiconnect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminiconnect%2Fminiconnect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminiconnect%2Fminiconnect/lists"}