110 lines
2.6 KiB
Go
110 lines
2.6 KiB
Go
// Code generated by sqlc. DO NOT EDIT.
|
|
// versions:
|
|
// sqlc v1.31.1
|
|
// source: copyfrom.go
|
|
|
|
package sqlc
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
// iteratorForCreatePostTag implements pgx.CopyFromSource.
|
|
type iteratorForCreatePostTag struct {
|
|
rows []CreatePostTagParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreatePostTag) 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 iteratorForCreatePostTag) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].PostID,
|
|
r.rows[0].TagID,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreatePostTag) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreatePostTag(ctx context.Context, arg []CreatePostTagParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"post_tag"}, []string{"post_id", "tag_id"}, &iteratorForCreatePostTag{rows: arg})
|
|
}
|
|
|
|
// iteratorForCreateRolePermission implements pgx.CopyFromSource.
|
|
type iteratorForCreateRolePermission struct {
|
|
rows []CreateRolePermissionParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateRolePermission) 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 iteratorForCreateRolePermission) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].RoleID,
|
|
r.rows[0].PermissionID,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateRolePermission) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateRolePermission(ctx context.Context, arg []CreateRolePermissionParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"sys_role_permission"}, []string{"role_id", "permission_id"}, &iteratorForCreateRolePermission{rows: arg})
|
|
}
|
|
|
|
// iteratorForCreateUserRole implements pgx.CopyFromSource.
|
|
type iteratorForCreateUserRole struct {
|
|
rows []CreateUserRoleParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateUserRole) 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 iteratorForCreateUserRole) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].UserID,
|
|
r.rows[0].RoleID,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateUserRole) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateUserRole(ctx context.Context, arg []CreateUserRoleParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"sys_user_role"}, []string{"user_id", "role_id"}, &iteratorForCreateUserRole{rows: arg})
|
|
}
|