Tighten DuckDB SQL handling#16
Open
Dagalon wants to merge 3 commits into
Open
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
KeeperRegisterIdDataBase.DeleteRegisterpodía lanzar al indexar cuando el id no existía porque usabaIndexOfsobre la lista de valores.QuoteIdentifier, y la sustitución de "parámetros" enExecuteQryReaderhacíastring.Replace, lo que no es seguro.Microsoft.Data.Sqliteen el.csprojde DuckDB en lugar deDuckDB.NET.Data.Full.Description
ConnectionManager.cs.DeleteRegistertolerante a ids ausentes buscando la clave conFirstOrDefault(...)y eliminando solo si existe.DuckTools.QuoteIdentifierde forma consistente a identificadores de base de datos, tablas y alias (CreateTable,CreateParquetTable,ATTACH) y protegí definiciones de columnas al quotear nombres de columnas.QueryExecutor.ExecuteQryReaderusandocmd.CreateParameter()ycmd.Parameters.Add(...), y añadíusingparaDuckDBCommand/IDataReaderdonde correspondía.DuckDB-Memory-Lib.csprojpara usarDuckDB.NET.Data.Full.DuckDB-Memory-Testspara cubrir la eliminación de registros inexistentes, el quoting de identificadores con espacios y la ejecución con parámetros que contienen comillas.Testing
git diff --checkpara validar el diff y no se reportaron problemas.dotnet test DuckDB-Memory-Tests/DuckDB-Memory-Tests.csproj --no-restoreperodotnetno está disponible en el entorno, por lo que las pruebas unitarias añadidas no pudieron ejecutarse aquí.DuckDB-Memory-Tests/T_DuckTools.csyDuckDB-Memory-Tests/T_Execute_Queries.cspara cubrir los cambios (no ejecutadas localmente debido a la ausencia dedotnet).Codex Task