-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make duckdb connection string support unicode path #197
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #197 +/- ##
===========================================
+ Coverage 88.38% 88.48% +0.10%
===========================================
Files 54 57 +3
Lines 1756 1841 +85
Branches 239 254 +15
===========================================
+ Hits 1552 1629 +77
- Misses 146 153 +7
- Partials 58 59 +1 ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 9515547530Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic for converting string to handle belongs to the Data project. The Bindings project should contain only method definitions
The |
You don't need to delete existing methods, just add a new overload. |
If I make it overload method, can accept it? NativeMethods.Startup.DuckDBOpen(null,out _);//<--- compile error, because the compiler unable to decide what method to execute. |
You can cast null to the desired type to help the compiler. |
What about that? [DllImport(DuckDbLibrary, CallingConvention = CallingConvention.Cdecl, EntryPoint = "duckdb_open")]
public static extern DuckDBState DuckDBOpen(SafeUnmanagedMemoryHandle path, out DuckDBDatabase database);
[DllImport(DuckDbLibrary, CallingConvention = CallingConvention.Cdecl, EntryPoint = "duckdb_open")]
public static extern DuckDBState DuckDBOpen(string? path, out DuckDBDatabase database);
//Usage
NativeMethods.Startup.DuckDBOpen((string?)null,out _); |
That should work. |
Completed |
You should not put logic in |
I know |
Yeah, that's what I meant. |
Fix #196