Merged in feature/jobsync (pull request #63)
Document Sync and Job Sync * docsyncfunc * startedQueryWork * morefixes * jobsyncsvcstart * save * jobsynctext * save * save * docsync * shorttest * jobsync * jobsyncupdateoncollectorupdate * passlivetest * collectortest * lint
This commit is contained in:
@@ -79,3 +79,41 @@ func (q *Queries) GetJob(ctx context.Context, jobid pgtype.UUID) (*GetJobRow, er
|
||||
err := row.Scan(&i.ID, &i.Clientid, &i.Cansync)
|
||||
return &i, err
|
||||
}
|
||||
|
||||
const listJobDocumentIDsBatch = `-- name: ListJobDocumentIDsBatch :many
|
||||
SELECT id, totalCount FROM listJobDocumentIDs($1, $2, $3)
|
||||
`
|
||||
|
||||
type ListJobDocumentIDsBatchParams struct {
|
||||
Jobid pgtype.UUID `db:"jobid"`
|
||||
Batchsize int32 `db:"batchsize"`
|
||||
Pageoffset int32 `db:"pageoffset"`
|
||||
}
|
||||
|
||||
type ListJobDocumentIDsBatchRow struct {
|
||||
ID pgtype.UUID `db:"id"`
|
||||
Totalcount *int64 `db:"totalcount"`
|
||||
}
|
||||
|
||||
// ListJobDocumentIDsBatch
|
||||
//
|
||||
// SELECT id, totalCount FROM listJobDocumentIDs($1, $2, $3)
|
||||
func (q *Queries) ListJobDocumentIDsBatch(ctx context.Context, arg *ListJobDocumentIDsBatchParams) ([]*ListJobDocumentIDsBatchRow, error) {
|
||||
rows, err := q.db.Query(ctx, listJobDocumentIDsBatch, arg.Jobid, arg.Batchsize, arg.Pageoffset)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
items := []*ListJobDocumentIDsBatchRow{}
|
||||
for rows.Next() {
|
||||
var i ListJobDocumentIDsBatchRow
|
||||
if err := rows.Scan(&i.ID, &i.Totalcount); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items = append(items, &i)
|
||||
}
|
||||
if err := rows.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user