feat(reflection): add JSON to DB column name mapping functions

* Implement BuildJSONToDBColumnMap for translating JSON keys to DB column names
* Enhance GetColumnName to extract column names with priority
* Update filterValidFields to utilize new mapping for improved data handling
* Fix TestToSnakeCase expected values for consistency
This commit is contained in:
Hein
2026-04-09 15:36:52 +02:00
parent 79a3912f93
commit f1ad83d966
3 changed files with 109 additions and 93 deletions

View File

@@ -823,12 +823,12 @@ func TestToSnakeCase(t *testing.T) {
{
name: "UserID",
input: "UserID",
expected: "user_i_d",
expected: "user_id",
},
{
name: "HTTPServer",
input: "HTTPServer",
expected: "h_t_t_p_server",
expected: "http_server",
},
{
name: "lowercase",
@@ -838,7 +838,7 @@ func TestToSnakeCase(t *testing.T) {
{
name: "UPPERCASE",
input: "UPPERCASE",
expected: "u_p_p_e_r_c_a_s_e",
expected: "uppercase",
},
{
name: "Single",