-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Implementation of the Connection.GetSchema of the DataSourceInformation collection #190
base: develop
Are you sure you want to change the base?
Conversation
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.
Thanks, added some minor comments.
DuckDB.NET.Data/DuckDBSchema.cs
Outdated
@@ -20,6 +22,7 @@ internal static class DuckDBSchema | |||
collectionName.ToUpperInvariant() switch | |||
{ | |||
"METADATACOLLECTIONS" => GetMetaDataCollections(), | |||
"DATASOURCEINFORMATION" => GetDataSourceInformation(NativeMethods.Startup.DuckDBLibraryVersion().ToManagedString(false)), |
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.
Replace with connection.ServerVersion
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.
Changed.
DuckDB.NET.Data/DuckDBSchema.cs
Outdated
serverVersion, | ||
serverVersion, | ||
GroupByBehavior.Unrelated, | ||
"(^\\[\\p{Lo}\\p{Lu}\\p{Ll}_@#][\\p{Lo}\\p{Lu}\\p{Ll}\\p{Nd}@$#_]*$)|(^\\[[^\\]\\0]|\\]\\]+\\]$)|(^\\\"[^\\\"\\0]|\\\"\\\"+\\\"$)", |
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.
Can you add comments explaining what these regexes do/mean and where they come from?
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.
Added comments.
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## develop #190 +/- ##
===========================================
+ Coverage 88.38% 88.73% +0.35%
===========================================
Files 54 54
Lines 1756 1802 +46
Branches 239 239
===========================================
+ Hits 1552 1599 +47
+ Misses 146 145 -1
Partials 58 58 ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 9157409247Details
💛 - Coveralls |
Is it possible to test it some other way? I.E what uses |
Connection.GetSchema("DataSourceInformation") is used by generic software which, through the ado.net providers, allows its use. The information returned by this primitive is used to generate statements in a generic way (see for example DbMetaDataColumnNames.ParameterMarkerPattern). |
Can you add a test that uses those APIs (that call |
// https://duckdb.org/docs/sql/query_syntax/prepared_statements | ||
{ | ||
"\\.", | ||
"DuckDB", |
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.
Here you return “DuckDB”, but test checks for “duckdb” (lowercase)
No description provided.