diff --git a/dal/db_query/queries.sql b/dal/db_query/queries.sql index 504438b..edc8588 100644 --- a/dal/db_query/queries.sql +++ b/dal/db_query/queries.sql @@ -1048,7 +1048,7 @@ RETURNING p.id, p.privilegeID, p.account_id, p.privilege_name, p.amount, p.creat -- name: GetExistingContactAmo :many WITH getAmoID AS ( - SELECT AmoID FROM amoContact WHERE amoContact.AccountID = $1 AND amoContact.Field IN ($2) + SELECT AmoID FROM amoContact WHERE amoContact.AccountID = $1 AND amoContact.Field IN ($2::text[]) ) SELECT DISTINCT * FROM amoContact WHERE amoContact.AccountID = $1 AND amoContact.AmoID IN (SELECT AmoID FROM getAmoID); diff --git a/dal/sqlcgen/queries.sql.go b/dal/sqlcgen/queries.sql.go index 3f6b18f..34eefd4 100644 --- a/dal/sqlcgen/queries.sql.go +++ b/dal/sqlcgen/queries.sql.go @@ -1451,18 +1451,18 @@ func (q *Queries) GetCurrentCompany(ctx context.Context, accountid string) (Acco const getExistingContactAmo = `-- name: GetExistingContactAmo :many WITH getAmoID AS ( - SELECT AmoID FROM amoContact WHERE amoContact.AccountID = $1 AND amoContact.Field IN ($2) + SELECT AmoID FROM amoContact WHERE amoContact.AccountID = $1 AND amoContact.Field IN ($2::text[]) ) SELECT DISTINCT id, accountid, amoid, field FROM amoContact WHERE amoContact.AccountID = $1 AND amoContact.AmoID IN (SELECT AmoID FROM getAmoID) ` type GetExistingContactAmoParams struct { - Accountid int32 `db:"accountid" json:"accountid"` - Field string `db:"field" json:"field"` + Accountid int32 `db:"accountid" json:"accountid"` + Column2 []string `db:"column_2" json:"column_2"` } func (q *Queries) GetExistingContactAmo(ctx context.Context, arg GetExistingContactAmoParams) ([]Amocontact, error) { - rows, err := q.db.QueryContext(ctx, getExistingContactAmo, arg.Accountid, arg.Field) + rows, err := q.db.QueryContext(ctx, getExistingContactAmo, arg.Accountid, pq.Array(arg.Column2)) if err != nil { return nil, err }