You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dao_node_run_job.go
    path of file: ./repos/cds/engine/api/workflow
    
    the code of the file until where you have to start completion: package workflow

import (
	"context"
	"database/sql"
	"strconv"
	"time"

	"github.com/go-gorp/gorp"
	"github.com/lib/pq"
	"github.com/rockbears/log"

	"github.com/ovh/cds/engine/api/database/gorpmapping"
	"github.com/ovh/cds/engine/api/group"
	"github.com/ovh/cds/engine/cache"
	"github.com/ovh/cds/sdk"
	"github.com/
    
func loadNodeJobRunQueue(ctx context.Context, db gorp.SqlExecutor, store cache.Store, query gorpmapping.Query, limit *int, skipBooked bool) ([]sdk.WorkflowNodeJobRun, error) {
	ctx, end := telemetry.Span(ctx, "workflow.loadNodeJobRunQueue")
	defer end()

	if limit != nil && *limit > 0 {
		query = query.Limit(*limit)
	}

	var sqlJobs []JobRun

	if err := gorpmapping.GetAll(ctx, db, query, &sqlJobs); err != nil {
		return nil, sdk.WrapError(err, "Unable to load job runs (Select)")
	}

	jobs := make([]sdk.WorkflowNodeJobRun, 0, len(sqlJobs))
	for i := range sqlJobs {
		getHatcheryInfo(ctx, store, &sqlJobs[i])
		if skipBooked && sqlJobs[i].BookedBy.ID != 0 {
			log.Info(ctx, "LoadNodeJobRunQueue> WorkflowNodeRunJob %d skipped (booked by %q)", sqlJobs[i].ID, sqlJobs[i].BookedBy.Name)
			continue
		}
		jr, err := sqlJobs[i].WorkflowNodeRunJob()
		if err != nil {
			log.Error(ctx, "LoadNodeJobRunQueue> WorkflowNodeRunJob error: %v", err)
			continue
		}
		jobs = append(jobs, jr)
	}

	return jobs, nil
}