Refactor connection managers to shared base; add identifier quoting and DuckDB parameter support#17
Closed
Dagalon wants to merge 4 commits into
Closed
Refactor connection managers to shared base; add identifier quoting and DuckDB parameter support#17Dagalon wants to merge 4 commits into
Dagalon wants to merge 4 commits into
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
ConnectionManagerBase<TConnection>inShared/ConnectionManagerBase.csand updateSqliteDB-Memory-Lib/ConnectionManager.csandDuckDB-Memory-Lib/ConnectionManager.csto inherit from the base and delegate connection creation viaGetConnectionCore.DuckDB.NET.Data.Full1.4.4and link the sharedConnectionManagerBase.csinto both projects via the.csprojchanges.DuckTools.QuoteIdentifierfor database/table/column names, updateDuckTools.AttachDatabaseto quote aliases, and fixQueryExecutorto build quoted table names.usingstatements forDuckDBCommand/readers and implement parameter binding inQueryExecutor.ExecuteQryReader(...)by creating parameters viaCreateParameterand normalizing names withNormalizeParameterName.KeeperRegisterIdDataBase.DeleteRegisterto locate and remove entries usingFirstOrDefaultwith case-insensitive value comparison and guard against missing keys.Testing
dotnet testfor the DuckDB test project includingT_QuoteIdentifier_And_ParameterName_Return_Safe_Sql_Tokens,T_DeleteRegister_Ignores_Missing_Id, andT_CreateTable_Quotes_Database_And_Table_Identifiers, and they passed.T_Create_Table_From_Parquetwhich succeeded using the updated DuckDB library and quoted identifiers.T_ExecuteQryReader_Uses_DuckDb_Parameterswhich validated parameterized queries and returned expected results.Codex Task