{"record":{"id":"9441aab6ef844071","repo":"tursodatabase/turso","slug":"keyword-not-supported-keyword","errorCode":null,"errorMessage":"Keyword not supported: {keyword}.","messagePattern":"Keyword not supported: (.+?)\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnectionStringBuilder.cs","lineNumber":222,"sourceCode":"\n    internal string GetTursoConnectionString()\n    {\n        var builder = new DbConnectionStringBuilder();\n        if (!string.IsNullOrEmpty(DataSource))\n            builder[\"Data Source\"] = DataSource;\n        if (DefaultTimeout != 30)\n            builder[\"Default Timeout\"] = DefaultTimeout;\n\n        return builder.ConnectionString;\n    }\n\n    private static string NormalizeKeyword(string keyword)\n    {\n        ArgumentException.ThrowIfNullOrWhiteSpace(keyword);\n        if (KeywordMap.TryGetValue(keyword, out var normalizedKeyword))\n            return normalizedKeyword;\n\n        throw new ArgumentException(Properties.Resources.KeywordNotSupported(keyword));\n    }\n\n    private string GetString(string keyword)\n    {\n        return base.TryGetValue(keyword, out var value)\n            ? Convert.ToString(value, CultureInfo.InvariantCulture) ?? string.Empty\n            : string.Empty;\n    }\n\n    private void SetString(string keyword, string? value)\n    {\n        if (value is null)\n            Remove(keyword);\n        else\n            this[keyword] = value;\n    }\n\n    private bool GetBool(string keyword, bool defaultValue = false)","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnectionStringBuilder.cs#L204-L240","documentation":"ArgumentException thrown by NormalizeKeyword when the connection-string builder's indexer (get or set) receives a keyword that is not in its KeywordMap. Only a fixed set is supported: Data Source/DataSource/Filename, Mode, Cache, Password, Foreign Keys/ForeignKeys, Recursive Triggers/RecursiveTriggers, Default Timeout/DefaultTimeout/Command Timeout/CommandTimeout, Pooling, Vfs, DateTimeKind, DateTimeFormat, BinaryGUID/BinaryGuid/Binary GUID, and Version. Unknown keys that Microsoft.Data.Sqlite or System.Data.SQLite accept (Cache Size, Page Size, Journal Mode, ...) are rejected here.","triggerScenarios":"builder[\"Cache Size\"] = 2000; passing \"Data Source=a.db;Journal Mode=Wal\" to the SqliteConnectionStringBuilder constructor; any indexer access or property that funnels through NormalizeKeyword with an unmapped key; note plain DbConnectionStringBuilder.Clear/Remove do not throw, only keyword-addressed access does.","commonSituations":"Copy-pasting connection strings from Microsoft.Data.Sqlite or System.Data.SQLite samples; tuning options (page size, cache size, busy timeout) carried over during a migration; dynamically building connection strings from user/config key-value pairs without filtering keys.","solutions":["Remove or filter out keywords not in the supported list; keep only the 13 canonical keywords exposed by builder.Keys.","Use the strongly-typed properties (builder.DataSource, builder.Mode, builder.Pooling, ...) instead of string indexer access.","If you parse arbitrary user config into the builder, whitelist keys with builder.ContainsKey(keyword) (which returns false instead of throwing) before setting."],"exampleFix":"// before\nvar builder = new SqliteConnectionStringBuilder(\"Data Source=app.db;Cache Size=2000;Page Size=4096\");\n\n// after\nvar builder = new SqliteConnectionStringBuilder(\"Data Source=app.db\");\n// drop unsupported tuning keywords; set supported ones via properties:\nbuilder.Mode = SqliteOpenMode.ReadWriteCreate;","handlingStrategy":"validation","validationCode":"foreach (var kv in rawConfig)\n    if (!builder.ContainsKey(kv.Key))\n        throw new ConfigException($\"Unsupported connection keyword '{kv.Key}'. Allowed: {string.Join(\", \", builder.Keys.Cast<string>())}\");\n    else\n        builder[kv.Key] = kv.Value;","typeGuard":null,"tryCatchPattern":"try { builder[key] = value; }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Keyword not supported\"))\n{ /* skip or map the keyword (e.g. drop provider-specific tuning keys) */ }","preventionTips":["Use strongly-typed properties (DataSource, Mode, Pooling, ...) instead of string keywords.","When migrating from Microsoft.Data.Sqlite, diff the keyword list and delete tuning keys this binding does not support."],"tags":["csharp","dotnet","connection-string","configuration"],"backgroundTag":"connection-string-invalid","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}