{"record":{"id":"4d779826a11a3aed","repo":"tursodatabase/turso","slug":"command-type-commandtype-is-not-supported","errorCode":null,"errorMessage":"Command type {commandType} is not supported.","messagePattern":"Command type (.+?) is not supported\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs","lineNumber":82,"sourceCode":"    }\n\n    public override int CommandTimeout\n    {\n        get => _commandTimeout;\n        set\n        {\n            ArgumentOutOfRangeException.ThrowIfNegative(value);\n            _commandTimeout = value;\n        }\n    }\n\n    public override CommandType CommandType\n    {\n        get => CommandType.Text;\n        set\n        {\n            if (value != CommandType.Text)\n                throw new ArgumentException(Properties.Resources.InvalidCommandType(value));\n        }\n    }\n\n    public override bool DesignTimeVisible { get; set; }\n\n    public override UpdateRowSource UpdatedRowSource { get; set; }\n\n    public new SqliteConnection? Connection\n    {\n        get => _connection;\n        set\n        {\n            ThrowIfReaderOpen(nameof(Connection));\n            _connection = value;\n            if (value is not null)\n            {\n                _commandTimeout = value.DefaultTimeout;\n                _transaction ??= value.Transaction;","sourceCodeStart":64,"sourceCodeEnd":100,"githubUrl":"https://github.com/tursodatabase/turso/blob/6c7252267988c76e632af00a671e4b9788dfae13/bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs#L64-L100","documentation":"The provider executes SQL text only: CommandType is fixed to Text, and setting StoredProcedure or TableDirect throws ArgumentException (Properties.Resources.InvalidCommandType). SQLite's engine has no stored-procedure or table-direct execution mode, so the setter rejects unsupported values eagerly instead of failing at prepare time.","triggerScenarios":"Ported System.Data code that sets cmd.CommandType = CommandType.StoredProcedure; ORMs/query builders that set CommandType from configuration; copy-paste from SQL Server or Oracle examples.","commonSituations":"Migrating ADO.NET codebases to SQLite; shared provider code branching on CommandType; tooling that auto-sets CommandType for command text starting with 'exec' or an object name.","solutions":["Remove the CommandType assignment - Text is the default and the only valid value.","Replace stored-procedure calls with the equivalent inline SQL statements (SQLite has no sprocs).","In cross-provider code, gate any CommandType assignment on the provider's capabilities."],"exampleFix":"// before\ncmd.CommandType = CommandType.StoredProcedure;\ncmd.CommandText = \"usp_GetUser\"; // throws: StoredProcedure not supported\n\n// after\ncmd.CommandType = CommandType.Text; // default; may be omitted\ncmd.CommandText = \"SELECT id, name FROM users WHERE id = $id\";","handlingStrategy":"validation","validationCode":"if (configuredType != CommandType.Text)\n    throw new NotSupportedException(\"SQLite provider supports CommandType.Text only\");\n\ncmd.CommandText = sql; // leave CommandType at its default","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set CommandType on SQLite commands.","Translate stored-procedure calls into plain SQL during migration.","Assert provider capabilities before generic paths assign CommandType."],"tags":["dotnet","ado-net","command-type","sqlite"],"backgroundTag":"unsupported-command-type","analyzedSha":"6c7252267988c76e632af00a671e4b9788dfae13","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}