mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Update Questdb
This commit is contained in:
parent
bb9b6c07ab
commit
ce3d941c28
@ -86,7 +86,7 @@ namespace SqlSugar
|
|||||||
var list = new List<Hashtable>();
|
var list = new List<Hashtable>();
|
||||||
var name = db.EntityMaintenance.GetEntityInfo<T>().DbTableName;
|
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, () =>
|
var columns = new ReflectionInoCacheService().GetOrCreate(key, () =>
|
||||||
db.CopyNew().DbMaintenance.GetColumnInfosByTableName(name));
|
db.CopyNew().DbMaintenance.GetColumnInfosByTableName(name));
|
||||||
columns.ForEach(d =>
|
columns.ForEach(d =>
|
||||||
@ -127,7 +127,7 @@ namespace SqlSugar
|
|||||||
httpContent.Headers.TryAddWithoutValidation("Content-Type",
|
httpContent.Headers.TryAddWithoutValidation("Content-Type",
|
||||||
"multipart/form-data; boundary=" + boundary);
|
"multipart/form-data; boundary=" + boundary);
|
||||||
var httpResponseMessage =
|
var httpResponseMessage =
|
||||||
await client.PostAsync($"{this.url}/imp?name={name}", httpContent);
|
await Post(client, name, httpContent);
|
||||||
var readAsStringAsync = await httpResponseMessage.Content.ReadAsStringAsync();
|
var readAsStringAsync = await httpResponseMessage.Content.ReadAsStringAsync();
|
||||||
var splitByLine = QuestDbRestAPHelper.SplitByLine(readAsStringAsync);
|
var splitByLine = QuestDbRestAPHelper.SplitByLine(readAsStringAsync);
|
||||||
foreach (var s in splitByLine)
|
foreach (var s in splitByLine)
|
||||||
@ -160,6 +160,18 @@ namespace SqlSugar
|
|||||||
return result;
|
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>
|
||||||
/// 批量快速插入
|
/// 批量快速插入
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user