-
Notifications
You must be signed in to change notification settings - Fork 148
Expand file tree
/
Copy pathriver_client_queue.sql.go
More file actions
62 lines (56 loc) · 1.42 KB
/
river_client_queue.sql.go
File metadata and controls
62 lines (56 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.29.0
// source: river_client_queue.sql
package dbsqlc
import (
"context"
"time"
"github.com/lib/pq"
)
const clientQueueCreateOrSetUpdatedAtMany = `-- name: ClientQueueCreateOrSetUpdatedAtMany :one
INSERT INTO /* TEMPLATE: schema */river_client_queue (
metadata,
name,
paused_at,
river_client_id,
updated_at
) VALUES (
coalesce($1::jsonb, '{}'),
unnest($2::text[]),
coalesce($3::timestamptz, NULL),
$4,
coalesce($5::timestamptz, now())
) ON CONFLICT (name) DO UPDATE
SET
updated_at = coalesce($5::timestamptz, now())
RETURNING river_client_id, name, created_at, max_workers, metadata, num_jobs_completed, num_jobs_running, updated_at
`
type ClientQueueCreateOrSetUpdatedAtManyParams struct {
Metadata string
Name []string
PausedAt *time.Time
RiverClientID string
UpdatedAt *time.Time
}
func (q *Queries) ClientQueueCreateOrSetUpdatedAtMany(ctx context.Context, db DBTX, arg *ClientQueueCreateOrSetUpdatedAtManyParams) (*RiverClientQueue, error) {
row := db.QueryRowContext(ctx, clientQueueCreateOrSetUpdatedAtMany,
arg.Metadata,
pq.Array(arg.Name),
arg.PausedAt,
arg.RiverClientID,
arg.UpdatedAt,
)
var i RiverClientQueue
err := row.Scan(
&i.RiverClientID,
&i.Name,
&i.CreatedAt,
&i.MaxWorkers,
&i.Metadata,
&i.NumJobsCompleted,
&i.NumJobsRunning,
&i.UpdatedAt,
)
return &i, err
}