insertMany is a shared code path for InsertMany and InsertManyTx, also used by the PeriodicJobEnqueuer.
(ctx context.Context, execTx riverdriver.ExecutorTx, insertParams []*rivertype.JobInsertParams)
| 1945 | // insertMany is a shared code path for InsertMany and InsertManyTx, also used |
| 1946 | // by the PeriodicJobEnqueuer. |
| 1947 | func (c *Client[TTx]) insertMany(ctx context.Context, execTx riverdriver.ExecutorTx, insertParams []*rivertype.JobInsertParams) ([]*rivertype.JobInsertResult, error) { |
| 1948 | return c.insertManyShared(ctx, execTx, insertParams, func(ctx context.Context, insertParams []*riverdriver.JobInsertFastParams) ([]*rivertype.JobInsertResult, error) { |
| 1949 | results, err := c.pilot.JobInsertMany(ctx, execTx, &riverdriver.JobInsertFastManyParams{ |
| 1950 | Jobs: insertParams, |
| 1951 | Schema: c.config.Schema, |
| 1952 | }) |
| 1953 | if err != nil { |
| 1954 | return nil, err |
| 1955 | } |
| 1956 | |
| 1957 | return sliceutil.Map(results, |
| 1958 | func(result *riverdriver.JobInsertFastResult) *rivertype.JobInsertResult { |
| 1959 | return (*rivertype.JobInsertResult)(result) |
| 1960 | }, |
| 1961 | ), nil |
| 1962 | }) |
| 1963 | } |
| 1964 | |
| 1965 | // The shared code path for all Insert and InsertMany methods. It takes a |
| 1966 | // function that executes the actual insert operation and allows for different |
no test coverage detected