Skip to content

Refactor#31

Merged
n-r-w merged 10 commits intomasterfrom
refactor
Jan 13, 2026
Merged

Refactor#31
n-r-w merged 10 commits intomasterfrom
refactor

Conversation

@n-r-w
Copy link
Owner

@n-r-w n-r-w commented Jan 13, 2026

No description provided.

n-r-w added 10 commits January 13, 2026 22:51
- Added `t.Parallel()` to all test functions across various test files to improve test execution speed by allowing concurrent test execution.
- Updated AGENTS.md to include usage instructions for golangci-lint.
…st cases

- Updated multiple test files to use `require.NoError` and `require.Error` instead of `assert.NoError` and `assert.Error` for better error handling.
- Ensured consistency across test cases in `delete_test.go`, `expr_test.go`, `insert_test.go`, `placeholder_test.go`, `select_test.go`, `statement_test.go`, `update_test.go`, and `where_test.go`.
- Improved readability and maintainability of tests by using `require` assertions.
- Updated error handling in insert, update, and select builders to use more concise error messages.
- Changed assertions in tests from assert to require for better failure handling.
- Refactored SQL generation methods to return named return values for clarity.
- Improved documentation comments for various methods to enhance code readability.
- Adjusted placeholder handling in SQL generation to ensure proper formatting.
- Enhanced pagination logic in the select builder to handle edge cases more effectively.
Copilot AI review requested due to automatic review settings January 13, 2026 22:21
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a comprehensive refactoring that improves code quality, maintainability, and performance without changing external behavior. It introduces a new linter configuration and addresses numerous linting issues throughout the codebase.

Changes:

  • Refactored large functions into smaller, focused helper functions for better readability
  • Enhanced test suite with parallel execution (t.Parallel()) and stricter error handling (require vs assert)
  • Improved error handling using errors.New() for static messages and better performance with strconv.FormatUint()

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
update.go Major refactoring: split toSqlRaw() into smaller helper functions (writePrefixes, writeSetClauses, etc.)
select.go Major refactoring: split toSqlRaw() into smaller helper functions, added explicit struct initialization
expr.go Refactored Eq.toSQL() into smaller functions (buildEqExpr, unwrapValue, etc.) for better maintainability
delete.go Error handling improvements, replaced fmt.Errorf() with errors.New(), added nolint comments
insert.go Documentation improvements, error handling updates, added nolint comments
statement.go Documentation improvements (added periods to comments)
placeholder.go Introduced escapedPlaceholder constant, added nolint comments
part.go Minor improvements: named return values, string comparison simplification
cte.go Error handling improvements, multi-line error message formatting, added nolint comments
case.go Documentation improvements, added explicit struct initialization
update_test.go Added t.Parallel() and switched to require for error assertions
select_test.go Added t.Parallel(), improved example functions with proper Output comments
insert_test.go Added t.Parallel() and switched to require for error assertions
delete_test.go Added t.Parallel() and switched to require for error assertions
expr_test.go Added t.Parallel() and switched to require for error assertions
cte_test.go Added t.Parallel(), new test cases for Replace and Delete operations
case_test.go Added t.Parallel() with proper closure handling for subtests
squirrel_test.go Removed unused DBStub code, added t.Parallel()
where_test.go Added t.Parallel(), changed assert.Equal to assert.Empty for better clarity
statement_test.go Added t.Parallel() and switched to require for error assertions
placeholder_test.go Added t.Parallel(), fixed assert.Equal argument order
.golangci.yml New comprehensive linter configuration with strict rules
.golangci.yaml Removed old linter configuration
AGENTS.md New documentation file describing tech stack and linting
.gitignore Added /.serena entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@n-r-w n-r-w merged commit 7417ee7 into master Jan 13, 2026
10 checks passed
@n-r-w n-r-w deleted the refactor branch January 13, 2026 22:27
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