Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miniconnect/miniconnect-api
MiniConnect API
https://github.com/miniconnect/miniconnect-api
database-access database-connector java sql
Last synced: 12 days ago
JSON representation
MiniConnect API
- Host: GitHub
- URL: https://github.com/miniconnect/miniconnect-api
- Owner: miniconnect
- License: apache-2.0
- Created: 2022-12-11T19:07:20.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T22:33:36.000Z (21 days ago)
- Last Synced: 2024-10-28T23:22:38.620Z (21 days ago)
- Topics: database-access, database-connector, java, sql
- Language: Java
- Homepage:
- Size: 278 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MiniConnect API
Minimalistic database API.
## Getting started
This API is an alternative to JDBC.
The philosophy is, that a minimalistic database access API should
do two things and nothing more:- send SQL queries and input data to the server
- accept the resultsThat's exactly what MiniConnect session API provides.
No odd abstractions like `startTransaction()` or `setCatalog()`.
No JDBC freaks like `nativeSQL()` or `setTypeMap()`.
Just a lightweight, REPL-able SQL interpreter.Here is a minimal example:
```java
try (MiniSession session = connectionFactory.connect()) {
MiniResult result = session.execute("SELECT name FROM employees");
try (MiniResultSet resultSet = result.resultSet()) {
ImmutableList row;
while ((row = resultSet.fetch()) != null) {
String name = row.get(0).contentAccess().get().toString();
System.out.println("name: " + name);
}
}
}
```To tell the truth, in practice there is a third one:
- sending large data in an efficient way
For this the `putLargeData()` method can be used:
```java
// ...session.putLargeData("mylargedata", 20000L, myDataInputStream);
// now, your large data is stored in the @mylargedata SQL variable
```