It turned out to connect to DuckDB via ODBC in the environment VStudio 13.6.1(x64) Windows 11(x64)
Download the nightly build of duckdb/v0.9.3-dev1100(windows_amd64) from the link
https://artifacts.duckdb.org/latest/duckdb-binaries-windows.zip
Install DuckDB ODBC driver
Create a DuckDB database file like 'E:/duckfile.db'.
Register a system DSN for this file, for example with the name 'duckfile'.
Create an ODBC connection in the Vstudio:
DSN name: duckfile
user: sa
Do not check the connection when creating. Save. Connect.
If you select this database in the 'Databases' tab, the studio will crash.
Therefore, immediately open the SQL editor and work from it.
==========================================================================
Let's check by executing queries in the SQL editor, for example:
SELECT version(); --> v0.9.3-dev1100
PRAGMA platform; --> windows_amd64
-- set the memory limit of the system to 1GB
SET memory_limit='1GB';
-- configure the system to use 2 threads
SET threads TO 2;
SELECT * FROM duckdb_settings() WHERE name = 'duckdb_api';
> name value description input_type
> duckdb_api duckdb/v0.9.3-dev1100(windows_amd64) odbc DuckDB API surface VARCHAR
SELECT * FROM duckdb_settings();
SELECT [1,2,3] as list_value, (1,2,3) as array_list;
SELECT (['a', 'b', 'c'])[3];
CREATE TABLE t1 (i INTEGER, j INTEGER);
INSERT INTO t1 SELECT 1, 2;
INSERT INTO t1 SELECT 2, 3;
SELECT * FROM t1;
PRAGMA table_info('t1');
-- Let's see which extensions are enabled by default.
SELECT * FROM duckdb_extensions();
SELECT * FROM read_csv_auto('E:/ADR.txt') LIMIT 100; --> OK
SELECT * FROM read_parquet('E:/AMK.pqz') LIMIT 100; --> OK
etc.
And all this happiness in one 24 MB DLL file, no dependencies.
Because DuckDB itself can handle a huge number of databases and data sources,
the studio will automatically acquire many features, in case of a small “finishing with a file” and the desire to do this work...
It would be great if the studio team found an opportunity to respond to my and Tyler’s proposal...