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:
Michael McGuinness
2025-02-12 19:00:25 +00:00
parent 25f41eb931
commit c1e9d93037
94 changed files with 1898 additions and 512 deletions
+38
View File
@@ -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
}