- 修复BulkCopy时间格式化问题

This commit is contained in:
dailyccc 2023-02-22 09:16:22 +08:00
parent 3f9afdad85
commit f6c70f254c

View File

@ -71,6 +71,10 @@ public static partial class QuestDbGlobalExtensions
/// <returns></returns>
public static async Task<int> ExecuteBulkCopyAsync<T>(this IInsert<T> that) where T : class
{
if (string.IsNullOrWhiteSpace(RestAPIExtension.BaseUrl))
{
throw new Exception("BulkCopy功能需要启用RestAPI启用方式new FreeSqlBuilder().UseQuestDbRestAPI(\"localhost:9000\", \"username\", \"password\")");
}
var result = 0;
var fileName = $"{Guid.NewGuid()}.csv";
var filePath = Path.Combine(AppContext.BaseDirectory, fileName);
@ -89,7 +93,7 @@ public static partial class QuestDbGlobalExtensions
{
{ "name", d.Name },
{ "type", d.DbTypeText },
{ "pattern", "yyyy/M/dd HH:mm:ss" }
{ "pattern", "yyyy/M/d H:mm:ss" }
});
}
else
@ -143,7 +147,7 @@ public static partial class QuestDbGlobalExtensions
{
try
{
File.Delete(filePath);
// File.Delete(filePath);
}
catch
{