mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-18 20:08:15 +08:00
- 增加 IInsertOrUpdate 高性能方法 ExecuteMySqlBulkCopy;
This commit is contained in:
@ -71,8 +71,14 @@ public static partial class FreeSqlPostgreSQLGlobalExtensions
|
||||
sb.Clear();
|
||||
try
|
||||
{
|
||||
upsert._sourceSql = $"select * from {tempTableName}";
|
||||
upsert._sourceSql = $"select __**__ from {tempTableName}";
|
||||
var sql2 = upsert.ToSql();
|
||||
if (string.IsNullOrWhiteSpace(sql2) == false)
|
||||
{
|
||||
var field = sql2.Substring(sql2.IndexOf("\"(") + 2);
|
||||
field = field.Remove(field.IndexOf(upsert._sourceSql)).TrimEnd().TrimEnd(')');
|
||||
sql2 = sql2.Replace(upsert._sourceSql, $"select {field} from {tempTableName}");
|
||||
}
|
||||
var sql3 = $"DROP TABLE {_commonUtils.QuoteSqlName(tempTableName)}";
|
||||
return NativeTuple.Create(sql1, sql2, sql3, tempTableName, _table.Columns.Values.Select(a => a.Attribute.Name).ToArray());
|
||||
}
|
||||
|
Reference in New Issue
Block a user