From f6c70f254c5c0e2b7cc7af7e2685552ea52b5963 Mon Sep 17 00:00:00 2001
From: dailyccc <963922242@qq.com>
Date: Wed, 22 Feb 2023 09:16:22 +0800
Subject: [PATCH] =?UTF-8?q?-=20=E4=BF=AE=E5=A4=8DBulkCopy=E6=97=B6?=
=?UTF-8?q?=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=96=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../FreeSql.Provider.QuestDb/QuestDbGlobalExtensions.cs | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/Providers/FreeSql.Provider.QuestDb/QuestDbGlobalExtensions.cs b/Providers/FreeSql.Provider.QuestDb/QuestDbGlobalExtensions.cs
index f53eb886..e8104237 100644
--- a/Providers/FreeSql.Provider.QuestDb/QuestDbGlobalExtensions.cs
+++ b/Providers/FreeSql.Provider.QuestDb/QuestDbGlobalExtensions.cs
@@ -71,6 +71,10 @@ public static partial class QuestDbGlobalExtensions
///
public static async Task ExecuteBulkCopyAsync(this IInsert 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
{