Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for arbitrary columns #852

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Rmarken5
Copy link

During the development of my project, I came across the need to execute a multi-table join using sqlx.This resulted in arbitrary column names in the result set. I aimed to scan the resulting rows into a slice of structs containing embedded structs with db tagging.

Unfortunately, I was unable to find any documentation for such a scenario. (I did see the "known issues" section of the readme)
After forking sqlx , replacing the package in my go mod file with my local version, debugging, and experimenting, I was able to achieve the desired result after a considerable amount of time.

In the interest of helping others who may encounter similar issues, I suggest extending the readme usage with an example directory that provides additional examples of not-so-straightforward scenarios. This will be beneficial for those adopting this package into their projects.

@dlsniper dlsniper added the needs testing The PR needs more testing before being accepted label Feb 1, 2024
@dlsniper
Copy link
Collaborator

dlsniper commented Feb 1, 2024

Hello, @ardan-bkennedy, and I recently stepped in to help maintain this project.
We are sorting the opened issues and pull requests. We'll look at the example provided and merge it if everything works as expected..
Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing The PR needs more testing before being accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants