From 0aa66ffc5c08781b2163f4d7074b0ee7928a99bc Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 17 Aug 2023 14:55:09 +0800 Subject: [PATCH] fix: use tmp dir to store (#69) --- con_batch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/con_batch.go b/con_batch.go index bad74fb..33e47a2 100644 --- a/con_batch.go +++ b/con_batch.go @@ -25,7 +25,7 @@ func (dc *DatabendConn) prepareBatch(ctx context.Context, query string) (ldriver if len(matches) < 2 { return nil, errors.New("cannot get table name from query") } - csvFileName := fmt.Sprintf("%s.csv", uuid.NewString()) + csvFileName := fmt.Sprintf("%s/%s.csv", os.TempDir(), uuid.NewString()) csvFile, err := os.OpenFile(csvFileName, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666) if err != nil {