Files
turso/bindings/java
Pekka Enberg fa883d1c6b Merge 'bindings/java: Refactor to favor composition over inheritance ' from Kim Seon Woo
## Changes
- AS-IS
  - `LimboConnection` implements `Connection`
  - `JDBC4Connection` implements `LimboConnection`
- TO-BE
  - `LimboConnection` doesn't implement `Connection`. It is used to
represent connection to limbo only.
  - `JDBC4Connection` implements `Connection` directly. Holds
`LimboConnection` in member field.
- This helps remove the complexity of java's `Connection` interface away
from `LimboConnection`. We can focus on implementing limbo's feature
inside `LimboConnection` and let `JDBC4Connection` handle the
interoperability with jdbc world.
## Reference
https://github.com/tursodatabase/limbo/issues/615

Closes #916
2025-02-10 12:13:30 +02:00
..
2025-02-06 20:54:13 +09:00
2025-01-05 10:28:05 +02:00
Nit
2025-02-07 13:50:00 +09:00
2025-01-05 10:28:05 +02:00
2025-01-05 10:28:05 +02:00
2025-01-05 10:28:05 +02:00

Limbo JDBC Driver

The Limbo JDBC driver is a library for accessing and creating Limbo 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`
$ make macos_x86

# deploy to maven local 
$ make publish_local

Now you can use the dependency as follows:

dependencies {
    implementation("org.github.tursodatabase:limbo:0.0.1-SNAPSHOT")
}

Code style

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