Skip to content

[Repo Assist] chore: minor code clarity improvements#456

Draft
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/improve-code-clarity-20260310-1b5cfc5d4600ce2d
Draft

[Repo Assist] chore: minor code clarity improvements#456
github-actions[bot] wants to merge 2 commits intomasterfrom
repo-assist/improve-code-clarity-20260310-1b5cfc5d4600ce2d

Conversation

@github-actions
Copy link
Contributor

🤖 This is an automated PR from Repo Assist.

Three small readability/cleanup changes with no behaviour impact.

Changes

src/SqlClient.DesignTime/SqlClientExtensions.fs

The SQL query that retrieves UDTT columns used ORDER BY c.column_id, tt.user_type_id, c.user_type_id. The primary sort key (c.column_id) is the column's position within a UDTT; the group key (tt.user_type_id) was secondary. While this produced correct results (because Array.groupBy preserves insertion order and each UDTT's columns appeared in column_id order in every group), the intent was not clear at a glance.

Changed to ORDER BY tt.user_type_id, c.column_id: group by table type first, then by column position — which directly expresses "for each table type, return columns in definition order". The redundant c.user_type_id tie-breaker (column's own type ID) was also removed since (tt.user_type_id, c.column_id) uniquely identifies each row.

src/SqlClient.DesignTime/SqlEnumProvider.fs

Removed two stale commented-out lines:

// let tempAssembly = ProvidedAssembly()
// do tempAssembly.AddTypes [providerType]

A ProvidedAssembly is already created per-instantiation inside the instantiationFunction lambda (line 66 / 266 in the original). The module-level draft was never activated.

src/SqlClient/Configuration.fs

Removed //this is mess. Clean up later. — a stale TODO comment from an early version of the file. The FsharpDataSqlClientConfiguration record + lock-guarded mutable current is straightforward as-is.

Test Status

Build: ✅ dotnet build src/SqlClient/SqlClient.fsproj -f netstandard2.0 succeeds — only pre-existing deprecation warnings (97), no new errors.

Full integration tests require a SQL Server instance and could not be run in this environment. All three changes are pure cleanup with no logic change, so regression risk is minimal.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

- SqlClientExtensions.fs: reorder UDTT column query ORDER BY to
  group by table type first, then by column position within each
  type (tt.user_type_id, c.column_id). The previous order
  (c.column_id, tt.user_type_id, c.user_type_id) produced the
  same result but was less readable. Also removes the redundant
  c.user_type_id tie-breaker.
- SqlEnumProvider.fs: remove two stale commented-out lines that
  were never used (ProvidedAssembly created per-instantiation
  in the lambda instead, at line 66).
- Configuration.fs: remove outdated 'this is mess' TODO comment.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants