update sqlc gen
This commit is contained in:
parent
dacc4c4eb5
commit
eeb6853b6a
@ -661,7 +661,7 @@ INSERT INTO tokens (AccountID, RefreshToken, AccessToken, AuthCode, Expiration,
|
|||||||
VALUES ($1, $2, $3, $4, $5, $6);
|
VALUES ($1, $2, $3, $4, $5, $6);
|
||||||
|
|
||||||
-- name: WebhookUpdate :exec
|
-- name: WebhookUpdate :exec
|
||||||
UPDATE tokens SET AccessToken = $1,RefreshToken = $2,Expiration = to_timestamp($3) AT TIME ZONE 'UTC' + INTERVAL '3 hours',CreatedAt = to_timestamp($4) AT TIME ZONE 'UTC' + INTERVAL '3 hours'
|
UPDATE tokens SET AccessToken = $1,RefreshToken = $2,Expiration = to_timestamp(($3)::bigint) AT TIME ZONE 'UTC' + INTERVAL '3 hours',CreatedAt = to_timestamp(($4)::bigint) AT TIME ZONE 'UTC' + INTERVAL '3 hours'
|
||||||
WHERE accountID = $5;
|
WHERE accountID = $5;
|
||||||
|
|
||||||
-- name: GetAllTokens :many
|
-- name: GetAllTokens :many
|
||||||
@ -1026,4 +1026,4 @@ INSERT INTO amoCRMStatuses (AccountID, DealID, AnswerID, Status)
|
|||||||
SELECT u.AmoID, $1, $2, $3
|
SELECT u.AmoID, $1, $2, $3
|
||||||
FROM tokens AS t
|
FROM tokens AS t
|
||||||
JOIN users AS u ON t.AccountID = u.AccountID
|
JOIN users AS u ON t.AccountID = u.AccountID
|
||||||
WHERE t.AccessToken = $4;
|
WHERE t.AccessToken = $4;
|
||||||
|
@ -3355,24 +3355,24 @@ func (q *Queries) WebhookDelete(ctx context.Context, amouserid int32) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const webhookUpdate = `-- name: WebhookUpdate :exec
|
const webhookUpdate = `-- name: WebhookUpdate :exec
|
||||||
UPDATE tokens SET AccessToken = $1,RefreshToken = $2,Expiration = to_timestamp($3) AT TIME ZONE 'UTC' + INTERVAL '3 hours',CreatedAt = to_timestamp($4) AT TIME ZONE 'UTC' + INTERVAL '3 hours'
|
UPDATE tokens SET AccessToken = $1,RefreshToken = $2,Expiration = to_timestamp(($3)::bigint) AT TIME ZONE 'UTC' + INTERVAL '3 hours',CreatedAt = to_timestamp(($4)::bigint) AT TIME ZONE 'UTC' + INTERVAL '3 hours'
|
||||||
WHERE accountID = $5
|
WHERE accountID = $5
|
||||||
`
|
`
|
||||||
|
|
||||||
type WebhookUpdateParams struct {
|
type WebhookUpdateParams struct {
|
||||||
Accesstoken string `db:"accesstoken" json:"accesstoken"`
|
Accesstoken string `db:"accesstoken" json:"accesstoken"`
|
||||||
Refreshtoken string `db:"refreshtoken" json:"refreshtoken"`
|
Refreshtoken string `db:"refreshtoken" json:"refreshtoken"`
|
||||||
ToTimestamp float64 `db:"to_timestamp" json:"to_timestamp"`
|
Column3 int64 `db:"column_3" json:"column_3"`
|
||||||
ToTimestamp_2 float64 `db:"to_timestamp_2" json:"to_timestamp_2"`
|
Column4 int64 `db:"column_4" json:"column_4"`
|
||||||
Accountid string `db:"accountid" json:"accountid"`
|
Accountid string `db:"accountid" json:"accountid"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q *Queries) WebhookUpdate(ctx context.Context, arg WebhookUpdateParams) error {
|
func (q *Queries) WebhookUpdate(ctx context.Context, arg WebhookUpdateParams) error {
|
||||||
_, err := q.db.ExecContext(ctx, webhookUpdate,
|
_, err := q.db.ExecContext(ctx, webhookUpdate,
|
||||||
arg.Accesstoken,
|
arg.Accesstoken,
|
||||||
arg.Refreshtoken,
|
arg.Refreshtoken,
|
||||||
arg.ToTimestamp,
|
arg.Column3,
|
||||||
arg.ToTimestamp_2,
|
arg.Column4,
|
||||||
arg.Accountid,
|
arg.Accountid,
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user