Skip to content

Comments

add mapper that applies to sql columns#25

Open
Minnowo wants to merge 1 commit intoVinovest:mainfrom
Minnowo:main
Open

add mapper that applies to sql columns#25
Minnowo wants to merge 1 commit intoVinovest:mainfrom
Minnowo:main

Conversation

@Minnowo
Copy link

@Minnowo Minnowo commented Feb 22, 2026

I was adding Sqlite as an additional database on one of my apps which is already using Postgres. It seems Postgres always returns column names in lowercase, but not Sqlite.

I ended up hitting a case where I had something like this:

SELECT *, xyz as some_lowercase_name
FROM table

And the column names from * would be uppercase, but not the some_lowercase_name column. Which caused a mapping error:

missing destination name VERSION in *database.TblConfig

This PR adds a new option to the mapper struct, that lets you map the sql column names too.

Copy link
Contributor

@mrj0 mrj0 left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

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