update sqlc gen
This commit is contained in:
parent
017c49a59e
commit
0f28fe5439
@ -2289,26 +2289,37 @@ func (q *Queries) GetUTMsWithPagination(ctx context.Context, arg GetUTMsWithPagi
|
||||
}
|
||||
|
||||
const getUserUTMByListIDs = `-- name: GetUserUTMByListIDs :many
|
||||
SELECT id, amofieldid, quizid, accountid, name, deleted, createdat FROM utms WHERE ID = ANY($1::int[]) AND Deleted = false
|
||||
SELECT utms.ID, utms.AmoFieldID, f.Entity AS AmoFieldType, utms.QuizID, utms.AccountID, utms.Name
|
||||
FROM utms
|
||||
JOIN fields f ON utms.AmoFieldID = f.AmoID
|
||||
WHERE utms.ID = ANY($1::int[]) AND utms.Deleted = false
|
||||
`
|
||||
|
||||
func (q *Queries) GetUserUTMByListIDs(ctx context.Context, dollar_1 []int32) ([]Utm, error) {
|
||||
type GetUserUTMByListIDsRow struct {
|
||||
ID int64 `db:"id" json:"id"`
|
||||
Amofieldid int32 `db:"amofieldid" json:"amofieldid"`
|
||||
Amofieldtype interface{} `db:"amofieldtype" json:"amofieldtype"`
|
||||
Quizid int32 `db:"quizid" json:"quizid"`
|
||||
Accountid int32 `db:"accountid" json:"accountid"`
|
||||
Name string `db:"name" json:"name"`
|
||||
}
|
||||
|
||||
func (q *Queries) GetUserUTMByListIDs(ctx context.Context, dollar_1 []int32) ([]GetUserUTMByListIDsRow, error) {
|
||||
rows, err := q.db.QueryContext(ctx, getUserUTMByListIDs, pq.Array(dollar_1))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var items []Utm
|
||||
var items []GetUserUTMByListIDsRow
|
||||
for rows.Next() {
|
||||
var i Utm
|
||||
var i GetUserUTMByListIDsRow
|
||||
if err := rows.Scan(
|
||||
&i.ID,
|
||||
&i.Amofieldid,
|
||||
&i.Amofieldtype,
|
||||
&i.Quizid,
|
||||
&i.Accountid,
|
||||
&i.Name,
|
||||
&i.Deleted,
|
||||
&i.Createdat,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user