46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
// source: copyfrom.go
|
|
|
|
package dbgen
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// iteratorForBulkCreateQuestionOptions implements pgx.CopyFromSource.
|
|
type iteratorForBulkCreateQuestionOptions struct {
|
|
rows []BulkCreateQuestionOptionsParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForBulkCreateQuestionOptions) Next() bool {
|
|
if len(r.rows) == 0 {
|
|
return false
|
|
}
|
|
if !r.skippedFirstNextCall {
|
|
r.skippedFirstNextCall = true
|
|
return true
|
|
}
|
|
r.rows = r.rows[1:]
|
|
return len(r.rows) > 0
|
|
}
|
|
|
|
func (r iteratorForBulkCreateQuestionOptions) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].QuestionID,
|
|
r.rows[0].OptionText,
|
|
r.rows[0].OptionOrder,
|
|
r.rows[0].IsCorrect,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForBulkCreateQuestionOptions) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) BulkCreateQuestionOptions(ctx context.Context, arg []BulkCreateQuestionOptionsParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"question_options"}, []string{"question_id", "option_text", "option_order", "is_correct"}, &iteratorForBulkCreateQuestionOptions{rows: arg})
|
|
}
|