Skip to content

Default CommandType to Text and Direction to Input - #372

Merged
Giorgi merged 1 commit into
Giorgi:developfrom
pengdows:fix/command-and-parameter-defaults
Oct 20, 2026
Merged

Giorgi merged 1 commit into
Giorgi:developfrom
pengdows:fix/command-and-parameter-defaults

Conversation

@alaricd

@alaricd alaricd commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

DuckDBCommand.CommandType and DuckDBParameter.Direction are auto-properties with no initializer, so a new command or parameter reports 0, which is not a defined value of either enum.

The contract

Before / after

new DuckDBCommand().CommandType    // before: (CommandType)0   after: CommandType.Text
new DuckDBParameter().Direction    // before: (ParameterDirection)0   after: ParameterDirection.Input

Code that branches on these (for example if (command.CommandType == CommandType.Text) in a data layer, or output-parameter handling that checks Direction) currently takes the wrong path for a freshly created object.

Change

Initialize both properties to their documented defaults. Tests: DuckDBCommandTests.CommandTypeDefaultsToText, ParameterCollectionTests.ParameterDirectionDefaultsToInput (constructor, name/value constructor, and CreateParameter()). The full test suite passes (7535 tests).

Conformance tests: CommandType_text_by_default, Parameter_default_Direction_is_input.

Found by the pengdows ADO.NET conformance suite, which runs the documented System.Data.Common contract against every provider; each failure it reports cites the learn.microsoft.com sentence the provider departs from.

🤖 Generated with Claude Code

IDbCommand.CommandType: "The default is Text."
DbParameter.Direction: "The default is Input."
Both auto-properties started at 0, which is not a CommandType or
ParameterDirection value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 39415705919

Coverage increased (+0.06%) to 92.552%

Details

  • Coverage increased (+0.06%) from the base build.
  • Patch coverage: 2 of 2 lines across 2 files are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4012
Covered Lines: 3776
Line Coverage: 94.12%
Relevant Branches: 2285
Covered Branches: 2052
Branch Coverage: 89.8%
Branches in Coverage %: Yes
Coverage Strength: 1004213.29 hits per line

💛 - Coveralls

@Giorgi
Giorgi merged commit 316a2aa into Giorgi:develop Oct 20, 2026
11 of 12 checks passed

This branch is waiting to be deployed

1 waiting deployment
external — 711a6e3b Waiting Oct 20, 2026 by alaricd via Authorize #676
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants