Closed Cricle closed 2 weeks ago
Attention: Patch coverage is 60.00000%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 88.48%. Comparing base (
c6437cc
) to head (9b924f6
). Report is 27 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
...ET.Bindings/NativeMethods/NativeMethods.Startup.cs | 60.00% | 3 Missing and 1 partial :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
DuckDB.NET.Bindings/NativeMethods/NativeMethods.Startup.cs | 7 | 10 | 70.0% | ||
<!-- | Total: | 7 | 10 | 70.0% | --> |
Totals | |
---|---|
Change from base Build 9511955148: | -0.1% |
Covered Lines: | 1688 |
Relevant Lines: | 1841 |
I think the logic for converting string to handle belongs to the Data project. The Bindings project should contain only method definitions
The NativeMethods.Startup.DuckDBOpen
will be a breakchang
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 NativeMethods.Startup
, just new overloads and call the correct one from the Data project.
I may not quite understand what you mean, can you explain it in detail?
I know
Yeah, that's what I meant.
Fix #196