Skip to content
Discussion options

You must be logged in to vote

This should work, (you can also have multiple sm.Columns mods if it will look cleaner).

bob.All(
        ctx, s.ex, 
        models.ResourceSearchResults.Query(
                sm.Columns(models.ResourceSearchResults.Columns.ColumnsExpr, expr.NewColumnsExpr("title_snippet", "description_snippet")),
        ),
        scan.StructMapper[ResourceSearchResultWithHighlights](),
)

I've been generally avoiding the query generation as sqlc left a bit of a bad taste in my mouth - but maybe it will generate what I need? I saw that you can add additional filters after the fact which would solve the issues I had with sqlc's query generation.

Yes, give this a try, it could be the right tool for the …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@absolutejam
Comment options

@stephenafamo
Comment options

Answer selected by absolutejam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants