Skip to content

Commit db7a805

Browse files
committed
dbeaver/pro#6613 1.0.5 version bump
1 parent f24a767 commit db7a805

File tree

3 files changed

+66
-3
lines changed

3 files changed

+66
-3
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Turso 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.
88
- It is a pure Java library
9-
- Version 1.0 uses simple [HTTP API](https://github.com/tursodatabase/libsql/blob/main/docs/http_api.md) protocol for LibSQL
9+
- Version 1.0.x uses simple [HTTP API](https://github.com/tursodatabase/libsql/blob/main/docs/http_api.md) protocol for LibSQL
1010
- It supports prepared statements, database metadata, resultsets, data types and most of other JDBC features
1111
- It supports Turso and local LibSQL servers
1212
- 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
@@ -18,10 +18,14 @@ Turso LibSQL [JDBC](https://en.wikipedia.org/wiki/JDBC_driver) is a library for
1818

1919
## Usage
2020

21-
JDBC URL format: `jdbc:dbeaver:libsql:<server-url>`
21+
JDBC URL format:
22+
- `jdbc:dbeaver:libsql:<server-url>` - classic JDBC form
23+
- `libsql://<server-host>` - Turso format
24+
2225
Server URL is a full URL including schema and port. For example:
2326
- `jdbc:dbeaver:libsql:http://localhost:1234`
2427
- `jdbc:dbeaver:libsql:https://test-test.turso.io`
28+
- `libsql://test-test.turso.io`
2529

2630
Token based authentication supported in version 1.0. Pass token value as password, leave the username empty.
2731

@@ -63,7 +67,7 @@ Download from Maven Central or from the releases page.
6367
<dependency>
6468
<groupId>com.dbeaver.jdbc</groupId>
6569
<artifactId>com.dbeaver.jdbc.driver.libsql</artifactId>
66-
<version>1.0.2</version>
70+
<version>1.0.4</version>
6771
</dependency>
6872
</dependencies>
6973
```

examples/connection/pom.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.dbeaver.jdbc</groupId>
5+
<artifactId>libsql-test-connection</artifactId>
6+
<version>0.0.1-SNAPSHOT</version>
7+
8+
<dependencies>
9+
<dependency>
10+
<groupId>com.dbeaver.jdbc</groupId>
11+
<artifactId>com.dbeaver.jdbc.driver.libsql</artifactId>
12+
<version>1.0.4</version>
13+
</dependency>
14+
</dependencies>
15+
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>org.codehaus.mojo</groupId>
20+
<artifactId>exec-maven-plugin</artifactId>
21+
<version>3.1.0</version>
22+
<configuration>
23+
<mainClass>com.dbeaver.test.libsql.LibSqlTest</mainClass>
24+
</configuration>
25+
</plugin>
26+
</plugins>
27+
</build>
28+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.dbeaver.test.libsql;
2+
3+
import java.sql.Connection;
4+
import java.sql.DriverManager;
5+
import java.sql.ResultSet;
6+
import java.sql.Statement;
7+
import java.util.Random;
8+
import java.util.UUID;
9+
10+
public class LibSqlTest {
11+
public static void main(String[] args) throws Exception {
12+
try (Connection connection = DriverManager.getConnection("jdbc:dbeaver:libsql:" + args[0], null, "password")) {
13+
try (Statement statement = connection.createStatement()) {
14+
String tableName = "test_table_" + UUID.randomUUID().toString().replace("-", "_");
15+
System.out.println("Test table: " + tableName);
16+
statement.execute("drop table if exists " + tableName);
17+
statement.execute("create table " + tableName + " (id integer, name string)");
18+
statement.execute("insert into " + tableName + " values(1, 'test one')");
19+
statement.execute("insert into " + tableName + " values(2, 'test two')");
20+
try (ResultSet rs = statement.executeQuery("select * from " + tableName)) {
21+
while (rs.next()) {
22+
System.out.println(rs.getInt("id") + " = " + rs.getString("name"));
23+
}
24+
}
25+
statement.executeUpdate("drop table " + tableName);
26+
}
27+
}
28+
}
29+
}
30+
31+

0 commit comments

Comments
 (0)