Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dbeaver/dbeaver-jdbc-libsql
LibSQL JDBC driver
https://github.com/dbeaver/dbeaver-jdbc-libsql
jdbc jdbc-driver libsql sqlite turso
Last synced: 7 days ago
JSON representation
LibSQL JDBC driver
- Host: GitHub
- URL: https://github.com/dbeaver/dbeaver-jdbc-libsql
- Owner: dbeaver
- License: apache-2.0
- Created: 2024-10-27T13:48:36.000Z (19 days ago)
- Default Branch: devel
- Last Pushed: 2024-11-06T08:06:49.000Z (9 days ago)
- Last Synced: 2024-11-06T08:34:43.273Z (9 days ago)
- Topics: jdbc, jdbc-driver, libsql, sqlite, turso
- Language: Java
- Homepage:
- Size: 124 KB
- Stars: 25
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LibSQL JDBC driver
[![CI](https://github.com/dbeaver/dbeaver-jdbc-libsql/actions/workflows/push-pr-devel.yml/badge.svg)](https://github.com/dbeaver/dbeaver-jdbc-libsql/actions/workflows/push-pr-devel.yml)
[![javadoc](https://javadoc.io/badge2/com.dbeaver.jdbc/com.dbeaver.jdbc.driver.libsql/javadoc.svg)](https://javadoc.io/doc/com.dbeaver.jdbc/com.dbeaver.jdbc.driver.libsql)
[![Apache 2.0](https://img.shields.io/github/license/cronn-de/jira-sync.svg)](http://www.apache.org/licenses/LICENSE-2.0)LibSQL [JDBC](https://en.wikipedia.org/wiki/JDBC_driver) is a library for accessing and managing [LibSQL](https://github.com/tursodatabase/libsql) databases in Java.
- It is a pure Java library
- Version 1.0 uses simple [HTTP API](https://github.com/tursodatabase/libsql/blob/main/docs/http_api.md) protocol for LibSQL
- It supports prepared statements, database metadata, resultsets, data types and most of other JDBC features
- It is included in [DBeaver](https://github.com/dbeaver/dbeaver) and [CloudBeaver](https://github.com/dbeaver/cloudbeaver) as default LibSQL driver. However, it can be used in any other products/frameworks which rely on JDBC API## Usage
JDBC URL format: `jdbc:dbeaver:libsql:`
Server URL is a full URL including schema and port. For example:
- `jdbc:dbeaver:libsql:http://localhost:1234`
- `jdbc:dbeaver:libsql:https://test-test.turso.io`Token based authentication supported in version 1.0. Pass token value as password, leave the username empty.
Driver class name: `com.dbeaver.jdbc.driver.libsql.LibSqlDriver`
## Example
```java
import java.sql.*;public class LibSqlTest {
public static void main(String[] args) throws Exception {
String databaseUrl = "http://libsql-server.company.local:8080";
try (Connection connection = DriverManager.getConnection("jdbc:dbeaver:libsql:" + databaseUrl)) {
try (Statement statement = connection.createStatement()) {
statement.execute("drop table if exists test_table_1");
statement.execute("create table test_table_1 (id integer, name string)");
statement.execute("insert into test_table_1 values(1, 'test one')");
statement.execute("insert into test_table_1 values(2, 'test two')");
try (ResultSet rs = statement.executeQuery("select * from test_table_1")) {
while (rs.next()) {
System.out.println(rs.getInt("id") + " = " + rs.getString("name"));
}
}
}
}
}
}
```
## LicenseLicensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
## Download
Download from Maven Central or from the releases page.
```xml
com.dbeaver.jdbc
com.dbeaver.jdbc.driver.libsql
1.0.2
```