110 lines
2.7 KiB
Go
110 lines
2.7 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})
|
|
}
|
|
|
|
// iteratorForCreateSysRolePermission implements pgx.CopyFromSource.
|
|
type iteratorForCreateSysRolePermission struct {
|
|
rows []CreateSysRolePermissionParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateSysRolePermission) 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 iteratorForCreateSysRolePermission) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].RoleID,
|
|
r.rows[0].PermissionID,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateSysRolePermission) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateSysRolePermission(ctx context.Context, arg []CreateSysRolePermissionParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"sys_role_permission"}, []string{"role_id", "permission_id"}, &iteratorForCreateSysRolePermission{rows: arg})
|
|
}
|
|
|
|
// iteratorForCreateSysUserRole implements pgx.CopyFromSource.
|
|
type iteratorForCreateSysUserRole struct {
|
|
rows []CreateSysUserRoleParams
|
|
skippedFirstNextCall bool
|
|
}
|
|
|
|
func (r *iteratorForCreateSysUserRole) 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 iteratorForCreateSysUserRole) Values() ([]interface{}, error) {
|
|
return []interface{}{
|
|
r.rows[0].UserID,
|
|
r.rows[0].RoleID,
|
|
}, nil
|
|
}
|
|
|
|
func (r iteratorForCreateSysUserRole) Err() error {
|
|
return nil
|
|
}
|
|
|
|
func (q *Queries) CreateSysUserRole(ctx context.Context, arg []CreateSysUserRoleParams) (int64, error) {
|
|
return q.db.CopyFrom(ctx, []string{"sys_user_role"}, []string{"user_id", "role_id"}, &iteratorForCreateSysUserRole{rows: arg})
|
|
}
|