mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-15 23:13:42 +08:00
Update mysql bulkcopy
This commit is contained in:
parent
b3af96998f
commit
7d9399fa7e
@ -95,6 +95,27 @@ namespace OrmTest
|
||||
.WhereColumns(it=>it.Mid).ToStorage();
|
||||
|
||||
x.AsInsertable.ExecuteCommand();
|
||||
|
||||
Db.CodeFirst.InitTables<UnitFastest001>();
|
||||
Db.DbMaintenance.TruncateTable<UnitFastest001>();
|
||||
var fastList = new List<UnitFastest001>()
|
||||
{
|
||||
new UnitFastest001 (){ Id=Guid.NewGuid()+"", Remark=@"aa
|
||||
raa" }
|
||||
};
|
||||
Db.Fastest<UnitFastest001>().BulkCopy(fastList);
|
||||
var searchList = Db.Queryable<UnitFastest001>().ToList();
|
||||
if (searchList.Count != 1)
|
||||
{
|
||||
throw new Exception("unit error");
|
||||
}
|
||||
}
|
||||
|
||||
public class UnitFastest001
|
||||
{
|
||||
public string Id { get; set; }
|
||||
[SqlSugar.SugarColumn(Length =1000)]
|
||||
public string Remark { get; set; }
|
||||
}
|
||||
public class MicroBlog
|
||||
{
|
||||
|
@ -164,7 +164,7 @@ namespace SqlSugar
|
||||
{
|
||||
colum = table.Columns[i];
|
||||
if (i != 0) sb.Append(",");
|
||||
if (colum.DataType == typeof(string) && row[colum].ToString().Contains(","))
|
||||
if (colum.DataType == typeof(string) &&( row[colum].ToString().Contains(",") || row[colum].ToString().Contains("\r")))
|
||||
{
|
||||
sb.Append("\"" + row[colum].ToString().Replace("\"", "\"\"") + "\"");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user