https://github.com/rqlite/rqlite-java
Java client for rqlite, the lightweight distributed relational database
https://github.com/rqlite/rqlite-java
java rqlite
Last synced: 9 months ago
JSON representation
Java client for rqlite, the lightweight distributed relational database
- Host: GitHub
- URL: https://github.com/rqlite/rqlite-java
- Owner: rqlite
- License: mit
- Archived: true
- Created: 2017-08-10T04:25:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-12-22T16:29:14.000Z (about 2 years ago)
- Last Synced: 2025-04-02T21:42:38.295Z (9 months ago)
- Topics: java, rqlite
- Language: Java
- Homepage:
- Size: 76.2 KB
- Stars: 31
- Watchers: 3
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rqlite-java
[](https://groups.google.com/group/rqlite)
This is a basic Java client library for [rqlite](https://github.com/rqlite/rqlite). rqlite is a lightweight, distributed relational database, which uses SQLite as its storage engine. Significant development and testing remains, and pull requests are welcome.
## Quick start
```java
// Declare variables.
ExecuteResults results = null;
QueryResults rows = null;
// Get a connection to a rqlite node.
Rqlite rqlite = RqliteFactory.connect("http", "localhost", 4001);
// Create a table.
results = rqlite.Execute("CREATE TABLE foo (id integer not null primary key, name text)");
System.out.println(results.toString());
// Insert a record.
results = rqlite.Execute("INSERT INTO foo(name) VALUES(\"fiona\")");
System.out.println(results.toString());
// Query all records in the table.
rows = rqlite.Query("SELECT * FROM foo", Rqlite.ReadConsistencyLevel.WEAK);
System.out.println(rows.toString());
```