Repository navigation
Commit 46a039a
authored
feat(jdbc): report live SQLite version from sqld via sqlite_version() (#21)
## Summary
Previously `getDatabaseProductVersion()`, `getDatabaseMajorVersion()`,
and `getDatabaseMinorVersion()` in `LibsqlDatabaseMetaData` returned
hardcoded values (`"3.0"`, `3`, `0`), regardless of the actual SQLite
version running inside the connected sqld instance.
## Changes
- Added a private `resolveDatabaseProductVersion()` helper that lazily
executes `SELECT sqlite_version()` against the server on first call and
caches the result on the metadata object.
- `getDatabaseProductVersion()` now returns the real version string
(e.g. `"3.46.1"`).
- `getDatabaseMajorVersion()` / `getDatabaseMinorVersion()` parse their
respective components from that string.
- A safe fallback to `"3.0"` / `3` / `0` is retained if the query fails
for any reason.
## Testing
- `spotless:apply` applied; `spotless:check` passes.
- `mvnw test -pl libsql-jdbc` passes.1 parent 65854b6 commit 46a039a
1 file changed
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
17 | 29 | | |
18 | 30 | | |
19 | 31 | | |
| |||
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
40 | | - | |
| 52 | + | |
41 | 53 | | |
42 | 54 | | |
43 | 55 | | |
| |||
381 | 393 | | |
382 | 394 | | |
383 | 395 | | |
384 | | - | |
385 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
386 | 404 | | |
387 | 405 | | |
388 | 406 | | |
| |||
0 commit comments