-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the DuckDBConnection support unicode file path (#197)
- Loading branch information
Showing
6 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using DuckDB.NET.Data; | ||
using System.IO; | ||
using Xunit; | ||
|
||
namespace DuckDB.NET.Test; | ||
|
||
public class OpenTests | ||
{ | ||
[Theory] | ||
[InlineData("中文", "中文.db")] | ||
[InlineData("english", "english.db")] | ||
[InlineData("한국어", "한국어.db")] | ||
public void OpenWithFile(string path,string fileName) | ||
{ | ||
var dir = Path.Combine(path); | ||
if (!Directory.Exists(dir)) | ||
{ | ||
Directory.CreateDirectory(dir); | ||
} | ||
var file = Path.Combine(dir, fileName); | ||
using (var conn=new DuckDBConnection($"Data Source={file}")) | ||
{ | ||
conn.Open(); | ||
} | ||
try | ||
{ | ||
File.Delete(file); | ||
Directory.Delete(dir); | ||
} | ||
catch (System.Exception) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters