Files
turso/bindings/java
Pekka Enberg 9b10c496db core: add Dialect trait and route schema loading through it
Introduce the Dialect trait as the boundary between the engine and the
SQL dialect a frontend speaks. The engine hardcodes SQLite behavior in
many places; the trait is the seam where a frontend substitutes its own
surface, growing one hook per behavior that moves behind it, with
SqliteDialect in core/dialect/sqlite.rs as the SQLite implementation.

The first hook is schema loading: every path that parses a
sqlite_schema table row back into a table definition now goes through
Dialect::parse_table_sql instead of calling BTreeTable::from_sql
directly. Rows written by internal engine paths (sequence backing
tables, sqlite_sequence) are plain SQLite text with no frontend marker,
so every dialect falls back to SQLite parsing for text it does not
recognize as its own.

The dialect is a mandatory, explicit argument on every database
constructor — open_file, open, open_new, from_uri, and the async and
bypass-registry variants — with no defaulting convenience wrappers:
SQLite-compatible callers state Arc::new(SqliteDialect) at the call
site, so the dialect a database runs under is always visible where it
is opened. It is fixed at open time because the schema is parsed during
open itself; a dialect installed later could never see rows stored by
another frontend. The process-wide database registry rejects an open
whose dialect name differs from the already-open instance, and
engine-initiated secondary opens (ATTACH) propagate the parent
database's dialect instead of assuming SQLite.
2026-07-16 10:36:39 +03:00
..
2026-01-20 16:55:52 +05:30
2025-10-08 15:43:27 +09:00
2026-01-20 16:55:52 +05:30
2025-07-13 11:43:26 -04:00
2025-07-13 11:43:26 -04:00
2026-07-13 18:12:11 +03:00
2025-01-05 10:28:05 +02:00
2025-01-05 10:28:05 +02:00
2025-07-03 10:56:05 -03:00
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.