Skip to content

[question???] How to sqlx.Select 2 values without Struct  #821

@MushiTheMoshi

Description

@MushiTheMoshi

Hi there,

First of all, really awesome work done here.

I have a quick question, can't find anywhere in the documentation how to catch a result of a sqlx.Select coming from a query
that selects 2 columns without using a struct:

//________________[ ORGS ]
func (db *DBORM) GetOrgs(Type string) (orgs []string, err error) {
	return orgs, db.Select(&orgs, `SELECT email,phone FROM "Orgs" WHERE type=$1`, Type)

I always get this ERROR:
type string with >1 columns (2)

Any help is much appreciated.

Thanks in advance,
Julio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions