-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDBC support #4
Comments
Hi, I have looked into this. Ideally, we would want to have something like https://github.com/xerial/sqlite-jdbc for libsql. I tried using the same jar with some modifications to support libsql, but I don't think that is viable, especially because libsql also runs in standalone mode. |
Thanks @manakbisht. If you want you can start with the http only libsql jdbc driver. It would translate JDBC calls into http requests to sqld. Here's the sqld http api specification: Please let me know if you have any questions. |
@haaawk sqld supports both HTTP/1.1 & /2. However, the server timeouts when I try to use HTTP/2. Here's an example snippet - HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("http://localhost:8080/v2"))
.timeout(Duration.of(10, ChronoUnit.SECONDS))
.GET()
.version(HttpClient.Version.HTTP_1_1) // replacing with HTTP_2 causes an HttpTimeoutException
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body()); This is the sqld server log - Took me a while to figure out because 2 is the default. Does this have to do with Java or sqld? Am I missing some config? |
v1 and v2 in the path are not versions of HTTP protocol but versions of HRANA protocol. It's an aplication level protocol that we use. |
Regarding support for HTTP/2. I believe sqld should support it so it's worth investigating why it does not work for you. |
This must be something specific to your local setup. I tried curl to the managed instance and it works using HTTP/2:
|
I understand that. I was not referring to the HRANA protocol.
This according to me implies, both HTTP/1.1 and HTTP/2. Am I misunderstanding this?
I was referring to the Java
Possibly. I am unable to use HTTP/2 with curl as well. So, the Java code is not the problem here.
The only difference I see here is that I am running the instance locally. |
You also run http vs https but it might be some flag on the sqld that you're missing. I will check if there's any relevant flag we're using on turso platform. |
Hi, We just released JDBC driver for LibSQL/Turso: https://github.com/dbeaver/dbeaver-jdbc-libsql (Apache license) It is a general purpose JDBC, in version 1.0 it supports most basic JDBC features. Currently we use it in DBeaver and CloudBeaver for LibSQL but perhaps it worth mentioning in the list of community SDKs. |
No description provided.
The text was updated successfully, but these errors were encountered: