|
@ -14,6 +14,7 @@ namespace SqlSugar |
|
|
internal SqlSugarProvider Context { get; set; } |
|
|
internal SqlSugarProvider Context { get; set; } |
|
|
internal ISqlBuilder Builder { get; set; } |
|
|
internal ISqlBuilder Builder { get; set; } |
|
|
internal T[] Entitys { get; set; } |
|
|
internal T[] Entitys { get; set; } |
|
|
|
|
|
internal string Chara { get; set; } |
|
|
private MySqlBlueCopy() |
|
|
private MySqlBlueCopy() |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
@ -24,6 +25,12 @@ namespace SqlSugar |
|
|
this.Builder = builder; |
|
|
this.Builder = builder; |
|
|
this.Entitys = entitys; |
|
|
this.Entitys = entitys; |
|
|
} |
|
|
} |
|
|
|
|
|
public bool ExecuteBlueCopy(string chara) |
|
|
|
|
|
{ |
|
|
|
|
|
this.Chara = chara; |
|
|
|
|
|
return ExecuteBlueCopy(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public bool ExecuteBlueCopy() |
|
|
public bool ExecuteBlueCopy() |
|
|
{ |
|
|
{ |
|
@ -76,7 +83,7 @@ namespace SqlSugar |
|
|
// IsolationLevel.Parse
|
|
|
// IsolationLevel.Parse
|
|
|
MySqlBulkLoader bulk = new MySqlBulkLoader(conn) |
|
|
MySqlBulkLoader bulk = new MySqlBulkLoader(conn) |
|
|
{ |
|
|
{ |
|
|
CharacterSet = "UTF8", |
|
|
CharacterSet = GetChara(), |
|
|
FieldTerminator = ",", |
|
|
FieldTerminator = ",", |
|
|
FieldQuotationCharacter = '"', |
|
|
FieldQuotationCharacter = '"', |
|
|
EscapeCharacter = '"', |
|
|
EscapeCharacter = '"', |
|
@ -105,11 +112,28 @@ namespace SqlSugar |
|
|
return IsBulkLoad; ; |
|
|
return IsBulkLoad; ; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private string GetChara() |
|
|
|
|
|
{ |
|
|
|
|
|
if (this.Chara == null) |
|
|
|
|
|
{ |
|
|
|
|
|
return "UTF8"; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
return this.Chara; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public Task<bool> ExecuteBlueCopyAsync() |
|
|
public Task<bool> ExecuteBlueCopyAsync() |
|
|
{ |
|
|
{ |
|
|
return Task.FromResult(ExecuteBlueCopy()); |
|
|
return Task.FromResult(ExecuteBlueCopy()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Task<bool> ExecuteBlueCopyAsync(string chara) |
|
|
|
|
|
{ |
|
|
|
|
|
this.Chara = chara; |
|
|
|
|
|
return Task.FromResult(ExecuteBlueCopy()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void CloseDb() |
|
|
private void CloseDb() |
|
|
{ |
|
|
{ |
|
|