From 8bc80d1457012dc4aa1de0e4fd3c351a58f88760 Mon Sep 17 00:00:00 2001 From: Pavel Date: Thu, 11 Jul 2024 16:26:52 +0300 Subject: [PATCH] update sqlc gen --- dal/sqlcgen/models.go | 15 ++++++++------- dal/sqlcgen/queries.sql.go | 26 ++++++++++++++++---------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/dal/sqlcgen/models.go b/dal/sqlcgen/models.go index 0a45556..1788137 100644 --- a/dal/sqlcgen/models.go +++ b/dal/sqlcgen/models.go @@ -81,13 +81,14 @@ type Field struct { } type Leadtarget struct { - ID int64 `db:"id" json:"id"` - Accountid string `db:"accountid" json:"accountid"` - Type interface{} `db:"type" json:"type"` - Quizid int32 `db:"quizid" json:"quizid"` - Target string `db:"target" json:"target"` - Deleted bool `db:"deleted" json:"deleted"` - Createdat time.Time `db:"createdat" json:"createdat"` + ID int64 `db:"id" json:"id"` + Accountid string `db:"accountid" json:"accountid"` + Type interface{} `db:"type" json:"type"` + Quizid int32 `db:"quizid" json:"quizid"` + Target string `db:"target" json:"target"` + Invitelink string `db:"invitelink" json:"invitelink"` + Deleted bool `db:"deleted" json:"deleted"` + Createdat time.Time `db:"createdat" json:"createdat"` } type Pipeline struct { diff --git a/dal/sqlcgen/queries.sql.go b/dal/sqlcgen/queries.sql.go index 47dc7cd..54a157b 100644 --- a/dal/sqlcgen/queries.sql.go +++ b/dal/sqlcgen/queries.sql.go @@ -707,14 +707,15 @@ func (q *Queries) CreateAmoAccount(ctx context.Context, arg CreateAmoAccountPara } const createLeadTarget = `-- name: CreateLeadTarget :one -INSERT INTO leadtarget (accountID,type,quizID,target) VALUES ($1,$2,$3,$4) RETURNING id, accountid, type, quizid, target, deleted, createdat +INSERT INTO leadtarget (accountID,type,quizID,target,InviteLink) VALUES ($1,$2,$3,$4,$5) RETURNING id, accountid, type, quizid, target, invitelink, deleted, createdat ` type CreateLeadTargetParams struct { - Accountid string `db:"accountid" json:"accountid"` - Type interface{} `db:"type" json:"type"` - Quizid int32 `db:"quizid" json:"quizid"` - Target string `db:"target" json:"target"` + Accountid string `db:"accountid" json:"accountid"` + Type interface{} `db:"type" json:"type"` + Quizid int32 `db:"quizid" json:"quizid"` + Target string `db:"target" json:"target"` + Invitelink string `db:"invitelink" json:"invitelink"` } func (q *Queries) CreateLeadTarget(ctx context.Context, arg CreateLeadTargetParams) (Leadtarget, error) { @@ -723,6 +724,7 @@ func (q *Queries) CreateLeadTarget(ctx context.Context, arg CreateLeadTargetPara arg.Type, arg.Quizid, arg.Target, + arg.Invitelink, ) var i Leadtarget err := row.Scan( @@ -731,6 +733,7 @@ func (q *Queries) CreateLeadTarget(ctx context.Context, arg CreateLeadTargetPara &i.Type, &i.Quizid, &i.Target, + &i.Invitelink, &i.Deleted, &i.Createdat, ) @@ -1757,7 +1760,7 @@ func (q *Queries) GetFieldsWithPagination(ctx context.Context, arg GetFieldsWith } const getLeadTarget = `-- name: GetLeadTarget :many -SELECT id, accountid, type, quizid, target, deleted, createdat FROM leadtarget WHERE accountID = $1 AND quizID = $2 AND deleted=false +SELECT id, accountid, type, quizid, target, invitelink, deleted, createdat FROM leadtarget WHERE accountID = $1 AND quizID = $2 AND deleted=false ` type GetLeadTargetParams struct { @@ -1780,6 +1783,7 @@ func (q *Queries) GetLeadTarget(ctx context.Context, arg GetLeadTargetParams) ([ &i.Type, &i.Quizid, &i.Target, + &i.Invitelink, &i.Deleted, &i.Createdat, ); err != nil { @@ -3715,16 +3719,17 @@ func (q *Queries) UpdateFields(ctx context.Context, dollar_1 json.RawMessage) er } const updateLeadTarget = `-- name: UpdateLeadTarget :one -UPDATE leadtarget SET target = $1 WHERE id = $2 AND deleted=false RETURNING id, accountid, type, quizid, target, deleted, createdat +UPDATE leadtarget SET target = $1,InviteLink = $2 WHERE id = $3 AND deleted=false RETURNING id, accountid, type, quizid, target, invitelink, deleted, createdat ` type UpdateLeadTargetParams struct { - Target string `db:"target" json:"target"` - ID int64 `db:"id" json:"id"` + Target string `db:"target" json:"target"` + Invitelink string `db:"invitelink" json:"invitelink"` + ID int64 `db:"id" json:"id"` } func (q *Queries) UpdateLeadTarget(ctx context.Context, arg UpdateLeadTargetParams) (Leadtarget, error) { - row := q.db.QueryRowContext(ctx, updateLeadTarget, arg.Target, arg.ID) + row := q.db.QueryRowContext(ctx, updateLeadTarget, arg.Target, arg.Invitelink, arg.ID) var i Leadtarget err := row.Scan( &i.ID, @@ -3732,6 +3737,7 @@ func (q *Queries) UpdateLeadTarget(ctx context.Context, arg UpdateLeadTargetPara &i.Type, &i.Quizid, &i.Target, + &i.Invitelink, &i.Deleted, &i.Createdat, )