limbo/bindings/java
Pekka Enberg edd45ff7b8 Improve MVCC DX by dropping --experimental-mvcc flag
The DX is right now pretty terrible:

```
penberg@vonneumann turso % cargo run -- hello.db
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s
     Running `target/debug/tursodb hello.db`
Turso v0.4.0-pre.18
Enter ".help" for usage hints.
Did you know that Turso supports live materialized views? Type .manual materialized-views to learn more.
This software is in BETA, use caution with production data and ensure you have backups.
turso> PRAGMA journal_mode = 'experimental_mvcc';
  × Invalid argument supplied: MVCC is not enabled. Enable it with `--experimental-mvcc` flag in the CLI or by setting the MVCC option in `DatabaseOpts`

turso>
```

To add insult to the injury, many SDKs don't even have a way to enable
MVCC via database options. Therefore, let's remove the flag altogether.
2025-12-19 12:59:42 +02:00
..
example close statements in text and example 2025-07-13 11:47:38 -04:00
gradle Change variable names 2025-10-08 15:43:27 +09:00
rs_src Improve MVCC DX by dropping --experimental-mvcc flag 2025-12-19 12:59:42 +02:00
src java bindings fixes 2025-12-11 17:18:11 +02:00
.editorconfig add dotfiles 2025-07-13 11:43:26 -04:00
.gitignore Add javadoc on classes and public methods for publishing to maven central 2025-10-07 23:33:02 +09:00
.sdkmanrc add dotfiles 2025-07-13 11:43:26 -04:00
build.gradle.kts Separate publish.gradle.kts from build.gradle.kts 2025-10-07 23:52:12 +09:00
Cargo.toml move as many dependencies as possible to workspace to avoid multiple versions of the same dependency 2025-09-15 17:19:36 -03:00
gradle.properties Turso 0.4.0-pre.18 2025-12-19 09:57:09 +02:00
gradlew Add support Java bindings 2025-01-05 10:28:05 +02:00
gradlew.bat Add support Java bindings 2025-01-05 10:28:05 +02:00
Makefile Fix Makefile libs command 2025-10-07 23:33:13 +09:00
README.md bind/java: Rename to Turso 2025-07-03 10:56:05 -03:00
settings.gradle.kts bind/java: Rename to Turso 2025-07-03 10:56:05 -03:00

Turso JDBC Driver

The Turso JDBC driver is a library for accessing and creating Turso database files using Java.

Project Status

The project is actively developed. Feel free to open issues and contribute.

To view related works, visit this issue.

How to use

Currently, we have not published to the maven central. Instead, you can locally build the jar and deploy it to maven local to use it.

Build jar and publish to maven local

$ cd bindings/java

# Please select the appropriate target platform, currently supports `macos_x86`, `macos_arm64`, `windows` and `linux_x86`
$ make macos_x86

# deploy to maven local
$ make publish_local

Now you can use the dependency as follows:

dependencies {
    implementation("tech.turso:turso:0.0.1-SNAPSHOT")
}

Code style

  • Favor composition over inheritance. For example, JDBC4Connection doesn't implement TursoConnection. Instead, it includes TursoConnection as a field. This approach allows us to preserve the characteristics of Turso using TursoConnection easily while maintaining interoperability with the Java world using JDBC4Connection.