代码拉取完成,页面将自动刷新
// 版权归GoFrame作者(https://goframe.org)所有。保留所有权利。
//
// 本源代码形式受MIT许可证条款约束。
// 如果未随本文件一同分发MIT许可证副本,
// 您可以在https://github.com/gogf/gf处获取。
// md5:a9832f33b234e3f3
package pgsql
import (
"context"
"database/sql"
gdb "gitee.com/go_888/goframe/database/gdb"
gcode "gitee.com/go_888/goframe/errors/gcode"
gerror "gitee.com/go_888/goframe/errors/gerror"
)
// X底层插入 为给定的表插入或更新数据。 md5:2a62d01f344269b8
func (d *Driver) X底层插入(ctx context.Context, link gdb.Link, table string, list gdb.X类型_Map数组, option gdb.X结构_DoInsertOption) (result sql.Result, err error) {
switch option.InsertOption {
case gdb.X常量_InsertOptionReplace:
return nil, gerror.X创建错误码(
gcode.X变量_CodeNotSupported,
`pgsql 驱动不支持 Replace 操作`,
)
case gdb.X常量_InsertOptionIgnore:
return nil, gerror.X创建错误码(
gcode.X变量_CodeNotSupported,
`pgsql 驱动不支持 Insert Ignore 操作`,
)
case gdb.X常量_InsertOptionDefault:
tableFields, err := d.X取Core对象().X取DB对象().X取表字段信息Map(ctx, table)
if err == nil {
for _, field := range tableFields {
if field.Key == "pri" {
pkField := *field
ctx = context.WithValue(ctx, internalPrimaryKeyInCtx, pkField)
break
}
}
}
}
return d.X结构_Core.X底层插入(ctx, link, table, list, option)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。