update sqlc gen

This commit is contained in:
Pavel 2024-04-18 16:50:25 +03:00
parent 50f5b8cdf0
commit 78dc91629c

@ -181,7 +181,7 @@ SELECT (new_fields->>'AmoID')::INT,
CAST(new_fields->>'Entity' AS entitytype),
new_fields->>'Type',
CURRENT_TIMESTAMP
FROM json_array_elements($2::json[]) AS new_fields
FROM json_array_elements($2::json) AS new_fields
JOIN user_data ON true
ON CONFLICT (amoID, accountID, entity) DO UPDATE
SET name = EXCLUDED.name,
@ -192,12 +192,12 @@ RETURNING id, amoid, code, accountid, name, entity, type, deleted, createdat
`
type CheckFieldsParams struct {
Accountid string `db:"accountid" json:"accountid"`
Column2 []json.RawMessage `db:"column_2" json:"column_2"`
Accountid string `db:"accountid" json:"accountid"`
Column2 json.RawMessage `db:"column_2" json:"column_2"`
}
func (q *Queries) CheckFields(ctx context.Context, arg CheckFieldsParams) ([]Field, error) {
rows, err := q.db.QueryContext(ctx, checkFields, arg.Accountid, pq.Array(arg.Column2))
rows, err := q.db.QueryContext(ctx, checkFields, arg.Accountid, arg.Column2)
if err != nil {
return nil, err
}
@ -236,7 +236,7 @@ SELECT (new_pipelines->>'AmoID')::INT,
new_pipelines->>'Name',
new_pipelines->>'IsArchive',
CURRENT_TIMESTAMP
FROM json_array_elements($1::json[]) AS new_pipelines
FROM json_array_elements($1::json) AS new_pipelines
ON CONFLICT (amoID, accountID) DO UPDATE
SET name = EXCLUDED.name,
isArchive = EXCLUDED.isArchive,
@ -244,8 +244,8 @@ ON CONFLICT (amoID, accountID) DO UPDATE
RETURNING id, amoid, accountid, name, isarchive, deleted, createdat
`
func (q *Queries) CheckPipelines(ctx context.Context, dollar_1 []json.RawMessage) ([]Pipeline, error) {
rows, err := q.db.QueryContext(ctx, checkPipelines, pq.Array(dollar_1))
func (q *Queries) CheckPipelines(ctx context.Context, dollar_1 json.RawMessage) ([]Pipeline, error) {
rows, err := q.db.QueryContext(ctx, checkPipelines, dollar_1)
if err != nil {
return nil, err
}
@ -329,7 +329,7 @@ SELECT (new_steps->>'AmoID')::INT,
new_steps->>'Name',
new_steps->>'Color',
CURRENT_TIMESTAMP
FROM json_array_elements($1::json[]) AS new_steps
FROM json_array_elements($1::json) AS new_steps
ON CONFLICT (amoID, accountID, PipelineID) DO UPDATE
SET name = EXCLUDED.name,
color = EXCLUDED.color,
@ -337,8 +337,8 @@ ON CONFLICT (amoID, accountID, PipelineID) DO UPDATE
RETURNING id, amoid, pipelineid, accountid, name, color, deleted, createdat
`
func (q *Queries) CheckSteps(ctx context.Context, dollar_1 []json.RawMessage) ([]Step, error) {
rows, err := q.db.QueryContext(ctx, checkSteps, pq.Array(dollar_1))
func (q *Queries) CheckSteps(ctx context.Context, dollar_1 json.RawMessage) ([]Step, error) {
rows, err := q.db.QueryContext(ctx, checkSteps, dollar_1)
if err != nil {
return nil, err
}
@ -382,7 +382,7 @@ SELECT (new_tags->>'AmoID')::INT,
new_tags->>'Name',
new_tags->>'Color',
CURRENT_TIMESTAMP
FROM json_array_elements($2::json[]) AS new_tags
FROM json_array_elements($2::json) AS new_tags
JOIN user_data ON true
ON CONFLICT (amoID, accountID, entity) DO UPDATE
SET name = EXCLUDED.name,
@ -392,12 +392,12 @@ RETURNING id, amoid, accountid, entity, name, color, deleted, createdat
`
type CheckTagsParams struct {
Accountid string `db:"accountid" json:"accountid"`
Column2 []json.RawMessage `db:"column_2" json:"column_2"`
Accountid string `db:"accountid" json:"accountid"`
Column2 json.RawMessage `db:"column_2" json:"column_2"`
}
func (q *Queries) CheckTags(ctx context.Context, arg CheckTagsParams) ([]Tag, error) {
rows, err := q.db.QueryContext(ctx, checkTags, arg.Accountid, pq.Array(arg.Column2))
rows, err := q.db.QueryContext(ctx, checkTags, arg.Accountid, arg.Column2)
if err != nil {
return nil, err
}