mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
merge master
This commit is contained in:
@ -155,7 +155,7 @@ func (d *Driver) doMergeInsert(
|
||||
return batchResult, nil
|
||||
}
|
||||
|
||||
// getPrimaryKeys retrieves the primary key field list of the table.
|
||||
// getPrimaryKeys retrieves the primary key field names of the table as a slice of strings.
|
||||
// This method extracts primary key information from TableFields.
|
||||
func (d *Driver) getPrimaryKeys(ctx context.Context, table string) ([]string, error) {
|
||||
tableFields, err := d.TableFields(ctx, table)
|
||||
@ -206,8 +206,7 @@ func parseSqlForMerge(table string,
|
||||
pattern, table, queryHolderStr, duplicateKeyStr, insertKeyStr, insertValueStr,
|
||||
strings.Join(updateValues, ","),
|
||||
)
|
||||
} else {
|
||||
// Insert Ignore: INSERT only
|
||||
return fmt.Sprintf(pattern, table, queryHolderStr, duplicateKeyStr, insertKeyStr, insertValueStr)
|
||||
}
|
||||
// Insert Ignore: INSERT only
|
||||
return fmt.Sprintf(pattern, table, queryHolderStr, duplicateKeyStr, insertKeyStr, insertValueStr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user