Skip to content

Preserve column names in page#40

Merged
klaidliadon merged 2 commits intomasterfrom
preserve-column
Feb 12, 2026
Merged

Preserve column names in page#40
klaidliadon merged 2 commits intomasterfrom
preserve-column

Conversation

@klaidliadon
Copy link
Contributor

No description provided.

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 ensures pagination order-building does not mutate caller-provided Page state (notably Page.Sort), preserving original column names while still generating sanitized SQL for ORDER BY.

Changes:

  • Update Page.GetOrder to copy p.Sort before sanitizing, preventing in-place modification of the original slice.
  • Extend pagination tests to assert page.Column / page.Sort[*].Column remain unchanged after query preparation.

Reviewed changes

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

File Description
page.go Copies Page.Sort before sanitization to avoid mutating caller input.
page_test.go Adds assertions verifying Page inputs (Column/Sort columns) are preserved across query preparation.

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

@klaidliadon klaidliadon merged commit 872bf82 into master Feb 12, 2026
1 check passed
@klaidliadon klaidliadon deleted the preserve-column branch February 12, 2026 15:03
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

Comments