mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 13:06:50 +08:00
Update Questdb
This commit is contained in:
parent
bb9b6c07ab
commit
ce3d941c28
@ -85,8 +85,8 @@ namespace SqlSugar
|
||||
var boundary = "---------------" + DateTime.Now.Ticks.ToString("x");
|
||||
var list = new List<Hashtable>();
|
||||
var name = db.EntityMaintenance.GetEntityInfo<T>().DbTableName;
|
||||
|
||||
var key ="QuestDbBulkCopy"+ typeof(T).FullName + typeof(T).GetHashCode();
|
||||
|
||||
var key = "QuestDbBulkCopy" + typeof(T).FullName + typeof(T).GetHashCode();
|
||||
var columns = new ReflectionInoCacheService().GetOrCreate(key, () =>
|
||||
db.CopyNew().DbMaintenance.GetColumnInfosByTableName(name));
|
||||
columns.ForEach(d =>
|
||||
@ -127,7 +127,7 @@ namespace SqlSugar
|
||||
httpContent.Headers.TryAddWithoutValidation("Content-Type",
|
||||
"multipart/form-data; boundary=" + boundary);
|
||||
var httpResponseMessage =
|
||||
await client.PostAsync($"{this.url}/imp?name={name}", httpContent);
|
||||
await Post(client, name, httpContent);
|
||||
var readAsStringAsync = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||
var splitByLine = QuestDbRestAPHelper.SplitByLine(readAsStringAsync);
|
||||
foreach (var s in splitByLine)
|
||||
@ -160,6 +160,18 @@ namespace SqlSugar
|
||||
return result;
|
||||
}
|
||||
|
||||
private Task<HttpResponseMessage> Post(HttpClient client, string name, MultipartFormDataContent httpContent)
|
||||
{
|
||||
try
|
||||
{
|
||||
return client.PostAsync($"{this.url}/imp?name={name}", httpContent);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 批量快速插入
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user