update sqlc gen

This commit is contained in:
Pavel 2024-07-11 16:26:52 +03:00
parent e6acec0da1
commit 8bc80d1457
2 changed files with 24 additions and 17 deletions

@ -81,13 +81,14 @@ type Field struct {
} }
type Leadtarget struct { type Leadtarget struct {
ID int64 `db:"id" json:"id"` ID int64 `db:"id" json:"id"`
Accountid string `db:"accountid" json:"accountid"` Accountid string `db:"accountid" json:"accountid"`
Type interface{} `db:"type" json:"type"` Type interface{} `db:"type" json:"type"`
Quizid int32 `db:"quizid" json:"quizid"` Quizid int32 `db:"quizid" json:"quizid"`
Target string `db:"target" json:"target"` Target string `db:"target" json:"target"`
Deleted bool `db:"deleted" json:"deleted"` Invitelink string `db:"invitelink" json:"invitelink"`
Createdat time.Time `db:"createdat" json:"createdat"` Deleted bool `db:"deleted" json:"deleted"`
Createdat time.Time `db:"createdat" json:"createdat"`
} }
type Pipeline struct { type Pipeline struct {

@ -707,14 +707,15 @@ func (q *Queries) CreateAmoAccount(ctx context.Context, arg CreateAmoAccountPara
} }
const createLeadTarget = `-- name: CreateLeadTarget :one 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 { type CreateLeadTargetParams struct {
Accountid string `db:"accountid" json:"accountid"` Accountid string `db:"accountid" json:"accountid"`
Type interface{} `db:"type" json:"type"` Type interface{} `db:"type" json:"type"`
Quizid int32 `db:"quizid" json:"quizid"` Quizid int32 `db:"quizid" json:"quizid"`
Target string `db:"target" json:"target"` Target string `db:"target" json:"target"`
Invitelink string `db:"invitelink" json:"invitelink"`
} }
func (q *Queries) CreateLeadTarget(ctx context.Context, arg CreateLeadTargetParams) (Leadtarget, error) { 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.Type,
arg.Quizid, arg.Quizid,
arg.Target, arg.Target,
arg.Invitelink,
) )
var i Leadtarget var i Leadtarget
err := row.Scan( err := row.Scan(
@ -731,6 +733,7 @@ func (q *Queries) CreateLeadTarget(ctx context.Context, arg CreateLeadTargetPara
&i.Type, &i.Type,
&i.Quizid, &i.Quizid,
&i.Target, &i.Target,
&i.Invitelink,
&i.Deleted, &i.Deleted,
&i.Createdat, &i.Createdat,
) )
@ -1757,7 +1760,7 @@ func (q *Queries) GetFieldsWithPagination(ctx context.Context, arg GetFieldsWith
} }
const getLeadTarget = `-- name: GetLeadTarget :many 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 { type GetLeadTargetParams struct {
@ -1780,6 +1783,7 @@ func (q *Queries) GetLeadTarget(ctx context.Context, arg GetLeadTargetParams) ([
&i.Type, &i.Type,
&i.Quizid, &i.Quizid,
&i.Target, &i.Target,
&i.Invitelink,
&i.Deleted, &i.Deleted,
&i.Createdat, &i.Createdat,
); err != nil { ); err != nil {
@ -3715,16 +3719,17 @@ func (q *Queries) UpdateFields(ctx context.Context, dollar_1 json.RawMessage) er
} }
const updateLeadTarget = `-- name: UpdateLeadTarget :one 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 { type UpdateLeadTargetParams struct {
Target string `db:"target" json:"target"` Target string `db:"target" json:"target"`
ID int64 `db:"id" json:"id"` Invitelink string `db:"invitelink" json:"invitelink"`
ID int64 `db:"id" json:"id"`
} }
func (q *Queries) UpdateLeadTarget(ctx context.Context, arg UpdateLeadTargetParams) (Leadtarget, error) { 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 var i Leadtarget
err := row.Scan( err := row.Scan(
&i.ID, &i.ID,
@ -3732,6 +3737,7 @@ func (q *Queries) UpdateLeadTarget(ctx context.Context, arg UpdateLeadTargetPara
&i.Type, &i.Type,
&i.Quizid, &i.Quizid,
&i.Target, &i.Target,
&i.Invitelink,
&i.Deleted, &i.Deleted,
&i.Createdat, &i.Createdat,
) )