Bug 160547 - Database Connection: JDBC-Connection with DuckDB fails
Summary: Database Connection: JDBC-Connection with DuckDB fails
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
24.2.2.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Database-Connectivity
  Show dependency treegraph
 
Reported: 2024-04-05 14:06 UTC by Robert Großkopf
Modified: 2024-08-05 10:55 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
trino jdbc (21.92 KB, image/png)
2024-07-18 15:34 UTC, Yuriy Gavrilov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2024-04-05 14:06:13 UTC
DuckDB (https://duckdb.org/) offers a JDBC-connection to connect to an existing DuckDB or will create a DB in memory.

Download https://repo1.maven.org/maven2/org/duckdb/duckdb_jdbc/0.10.1/duckdb_jdbc-0.10.1.jar to connect. Put this file in class path of LO.
Class is org.duckdb.DuckDBDriver.
Write in jdbc-connection 'duckdb:'. This would run a DuckDB in memory.

You could test the class - works.
You could test the connection - works.
You could try to open tables folder and get

Invalid Input Error: Unrecognized configuration property "Type" at /home/buildslave/source/libo-core/connectivity/source/drivers/jdbc/Object.cxx:173

Same driver runs without any problem together with DBeaver. So this one seems to be a special buggy behavior of LO.

See: https://ask.libreoffice.org/t/input-on-establishing-base-jdbc-connection-to-duckdb-on-windows-10/104331

My System: OpenSUSE 15.6 64bit rpm Linux, LO 24.2.2.2
Comment 1 emailin 2024-04-05 17:43:43 UTC
This error also results on Windows 10, and when setting the JDBC connection to an pre-existing and persistent DuckDB database, eg:
`duckdb: C:\Users\Me\Documents\my_database.db`
Comment 2 Alex Thurgood 2024-04-08 09:18:10 UTC
Confirming also with:

Version: 7.6.4.1 (AARCH64) / LibreOffice Community
Build ID: e19e193f88cd6c0525a17fb7a176ed8e6a3e2aa1
CPU threads: 8; OS: Mac OS X 14.4.1; UI render: Skia/Raster; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded

In many ways, the behaviour is similar to using SQLite.

An in memory database can be created and using Tools > SQL allows you to create a table and insert test data (e.g. using the statements from https://duckdb.org/docs/api/java.html)

However, it is impossible to display any of the database objects, use queries, use the wizards, etc. For example, trying a query via the SQL query option leads to an error that displays

Could not load content of data
prepareStatement 

Turning on/off the design mode leads to the following error:

The database contains neither a table nor a query named "items".

Confirming
Comment 3 Alex Thurgood 2024-04-08 09:20:28 UTC
FWIW, when I unload, and the reload the ODB file, I see exactly the same message as @Robert.
Comment 4 Julien Nabet 2024-05-07 13:50:07 UTC
"getTypeInfo" not supported in JDBC driver, see:
https://github.com/duckdb/duckdb-java/blob/main/src/main/java/org/duckdb/DuckDBDatabaseMetaData.java

Now I don't know if having this method implemented in JDBC is mandatory for LO or if we could find a way to make it optional.
Comment 5 Yuriy Gavrilov 2024-07-18 15:34:47 UTC
Created attachment 195374 [details]
trino jdbc
Comment 6 Yuriy Gavrilov 2024-07-18 15:35:30 UTC
Same bug with Trino jdbc look at the .png