The DuckDb driver is not included in the packages yet. To use it you will have to install Zeos into your IDE as usual. Then you need to create a new project and add the Zeos source folders (src/core, src/parsesql, src/plain, src/dbc, src/component) to the unit search path, so the DuckDB units can be found. Then you need to add the ZDbcDuckDB unit to your project. This will make the DuckDB driver available to your application.
The following code will create a database or open it, if it already exists:
Code: Select all
begin
ZConnection.Protocol := 'DuckDB';
ZConnection.LibraryLocation := 'C:\Projects\Zeos\clientlibs\duckdb-1.1.3\duckdb.dll';
ZConnection.ClientCodepage := 'UTF8';
ZConnection.Database := 'C:\Users\marsupilami\Documents\test.duckdb';
ZConnection.Connect;
ShowMessage('Connected');
end;
Varchar is mapped to TMemoField because varchars in DuckDB are not restricted in length and there is not even a hint what the developer has intended for lenght.
The driver still has shortcomings, they are documented in the Wiki: https://sourceforge.net/p/zeoslib/wiki/DuckDB/
Opinion? Questions?