Skip to content

Conversation

@Yaraslaut
Copy link
Member

Closes #366
This was actually a bug

@Yaraslaut Yaraslaut requested a review from a team as a code owner October 22, 2025 18:08
@Yaraslaut Yaraslaut force-pushed the fix/usage_of_alias_names branch 2 times, most recently from 23f96c9 to ca74fe0 Compare October 22, 2025 18:23
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 fixes a bug where the DataMapper's Update and Delete operations were using C++ field identifiers instead of SQL column name aliases, causing failures when field names differed from their database column names.

Key Changes:

  • Updated Update and Delete operations to use FieldNameOf and FieldNameAt for proper SQL column name resolution
  • Migrated from CallOnMembers to CallOnMembersWithoutName to work with field indices instead of identifiers
  • Added comprehensive test coverage with Person model using aliased column names

Reviewed Changes

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

File Description
src/Lightweight/DataMapper/DataMapper.hpp Fixed Update and Delete methods to use SQL column name aliases instead of C++ field identifiers
src/tests/DataMapper/NamingTests.cpp Added Person model and CRUD test case validating proper alias usage in all operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Yaraslaut Yaraslaut force-pushed the fix/usage_of_alias_names branch 4 times, most recently from 84d8041 to 3ab5cb1 Compare October 22, 2025 18:58
@Yaraslaut Yaraslaut force-pushed the fix/usage_of_alias_names branch from 3ab5cb1 to 0d255fe Compare October 22, 2025 19:03
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.

Add test where the PK is an aliased column, to ensure that dm.Delete(record) works as expected in C++23 as well as C++26 reflection.

2 participants