Skip to content

Fix code quality issues in SqlDecimal migration#81

Closed
Copilot wants to merge 4 commits intodev/monamaki/useSqlDecimalfrom
copilot/sub-pr-80
Closed

Fix code quality issues in SqlDecimal migration#81
Copilot wants to merge 4 commits intodev/monamaki/useSqlDecimalfrom
copilot/sub-pr-80

Conversation

Copy link

Copilot AI commented Mar 19, 2026

Addresses code quality issues found during review of the decimalSqlDecimal migration for full 38-digit SQL Server NUMERIC/DECIMAL precision support.

Changes

  • Fix broken indentation in ExtractNumericColumn — The if/else pattern had the else block body at the wrong nesting level. Restored early-return guard clause, which is both correct and consistent with the rest of the codebase.

  • Replace magic number with named constant*strLenOrNullMap = 19*strLenOrNullMap = SqlNumericStructSize in CSharpParamContainer.cs. The constant already exists in Sql.cs and is used elsewhere for the same purpose.

  • Remove unused import and stray blank line in SqlNumericHelper.cs (System.Linq was never referenced).

Before/After (ExtractNumericColumn)

// Before: broken indentation, else block body not indented
if (column == null)
{
    SetDataPtrs<SqlNumericStruct>(columnNumber, Array.Empty<SqlNumericStruct>());
}
else
{
            // ← code at wrong indent level
byte precision = 0;
...
                // ← inconsistent
                SetDataPtrs<SqlNumericStruct>(columnNumber, numericArray);
            }

// After: early return, flat structure
if (column == null)
{
    SetDataPtrs<SqlNumericStruct>(columnNumber, Array.Empty<SqlNumericStruct>());
    return;
}

byte precision = 0;
...
SetDataPtrs<SqlNumericStruct>(columnNumber, numericArray);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits March 19, 2026 23:44
Co-authored-by: monamaki <77026206+monamaki@users.noreply.github.com>
Co-authored-by: monamaki <77026206+monamaki@users.noreply.github.com>
Co-authored-by: monamaki <77026206+monamaki@users.noreply.github.com>
Copilot AI changed the title [WIP] Update SQL handling for decimal values Fix code quality issues in SqlDecimal migration Mar 19, 2026
Copilot AI requested a review from monamaki March 19, 2026 23:47
@monamaki monamaki closed this Mar 20, 2026
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.

2 participants