1. At the moment, to set the configuration I need, I use a snippet, executing it when opening the DB.
Is it possible to implement something like this:
When opening the DB "DBNAME.DDB" check the folder for the presence of the initialization file "DBNAME.INI", containing configuration parameters that differ from the default or any queries that need to be executed at startup. For example:
SET memory_limit='16GB';
SET threads=4;
SET pivot_limit=100;
SET default_collation = nocase;
SET home_directory='E:\DUCK_DATA';
SET extension_directory='E:\DUCK_DATA\EXT';
If it exists, execute it when establishing a connection.
Is it possible to add the Properties panel selection to the list (as is done for VDB) and, when opening this tab, execute the query: FROM duckdb_settings(), displaying information in this panel.
And also, as is the case for VDB, make these parameters editable, saving the changes to the "DBNAME.INI" file.
2. When requested, the Studio returns an incomplete table creation script. This is especially problematic for tables that look at external data - csv, parquet, etc.
For example, I create a table:
CREATE TABLE JRN_TSV (
DTM TIMESTAMP NOT NULL,
ELP USMALLINT NOT NULL,
... any fields ...
PRF VARCHAR NOT NULL,
ANS BOOLEAN NOT NULL )
AS
SELECT * FROM read_csv('E:/DUCK_DATA/CSV/JRN.tsv', DELIM=' ', header=TRUE, QUOTE='', ESCAPE='', columns={'DTM': 'DATETIME', 'ELP': 'UINT16', ... any fields ... 'PRF': 'CHAR', 'ANS': 'BOOL'});
Later I ask PopUP->Generate Query->Create.. to show me the table creation script. I get a truncated result:
CREATE TABLE "main"."JRN_TSV" (
"DTM" Timestamp NOT NULL,
"ELP" USmallInt NOT NULL,
... any fields ...
"PRF" VarChar NOT NULL,
"ANS" Boolean NOT NULL );
SELECT sql FROM duckdb_tables() WHERE table_name='JRN_TSV';
gives the same result. DBeaver has similar behavior - it also returns a truncated DDL script.
But the table reads the data normally - does that mean this metadata is stored somewhere?
I couldn't find how to get to it.
A similar problem also concerns MySQL_Plugin, I gave an example in some ticket on MANTIS, but in the case of MySQL at least through SHOW you can get to the exact metadata.
By the way, I once again appreciated your idea with virtual links!
The DuckDB team recommends using PK, FK and indexes in general only in extreme cases when it is really necessary, and here your idea is very useful. It is convenient to view related records in the editor and see the relationships between tables.