How to store query results in maps

How to store query results in maps

This is a pretty broad question. SQLX has a MapScan func that might be of use to you though in terms of a general approach:

Long and short of it is: return a row iterator, then iterate over it and create your map. It’s unclear to me if you are trying to create a map per row or a map with all values from a single column or something else. But - that should get you started.