When using a builder to set a connection string (e.g., to perform validation and avoid the possibility of getting errors like IndexOutOfBoundsException when setting it directly), the keys are changed to lower case. For example if connectionString is set to DataSource=:memory: then the following code will set it to datasource=:memory:
var builder = DbProviderFactories.GetFactory(DuckDBClientFactory.ProviderInvariantName).CreateConnectionStringBuilder();
builder!.ConnectionString = connectionString;
connectionString = builder.ConnectionString;
Consider adding support for case insensitive keys.
The current codebase assumes
DataSource
orData Source
as the data source key in a connection string and fails for lower case variants in https://github.com/Giorgi/DuckDB.NET/blob/f933d9b7912a981399f4dd382a5695446d01ba5c/DuckDB.NET.Data/ConnectionString/DuckDBConnectionStringParser.cs#L20When using a builder to set a connection string (e.g., to perform validation and avoid the possibility of getting errors like IndexOutOfBoundsException when setting it directly), the keys are changed to lower case. For example if
connectionString
is set toDataSource=:memory:
then the following code will set it todatasource=:memory:
Consider adding support for case insensitive keys.