48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.30.0
|
|
// source: copyfrom.go
|
|
|
|
package repo
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// iteratorForBatchInsertMoneyUserCategories implements pgx.CopyFromSource.
|
|
type iteratorForBatchInsertMoneyUserCategories struct {
|
|
rows []BatchInsertMoneyUserCategoriesParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForBatchInsertMoneyUserCategories) 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 iteratorForBatchInsertMoneyUserCategories) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].ID,
|
|
r.rows[0].UserID,
|
|
r.rows[0].Name,
|
|
r.rows[0].Icon,
|
|
r.rows[0].Type,
|
|
r.rows[0].SortNumber,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForBatchInsertMoneyUserCategories) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) BatchInsertMoneyUserCategories(ctx context.Context, arg []BatchInsertMoneyUserCategoriesParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"money_user_category"}, []string{"id", "user_id", "name", "icon", "type", "sort_number"}, &iteratorForBatchInsertMoneyUserCategories{rows: arg})
|
|
}
|