Support executing sql with template literal - #13
Open
miyaji255 wants to merge 2 commits into
Open
Conversation
miyaji255
force-pushed
the
add-execute-with-template-literal
branch
from
September 30, 2025 15:47
51bc795 to
1e0a392
Compare
Owner
|
This may be useful, but I personally prefer explicitly passing parameters. Also, this has a problem where it doesn't work in Unity in a C# 9.0 environment. It might be better to add an overload to ExecuteNonQuery that allows passing parameters like string.Format. |
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.
This pull request introduces support for interpolated string handlers in SQL command execution, improving both performance and developer ergonomics. The main changes include the addition of the
ExecuteInterporatedStringHandlertype, updates toSqliteConnectionto accept this new handler for executing commands, and enhancements to parameter binding. These changes allow SQL queries to be constructed more safely and efficiently using interpolated strings.Interpolated String Handler Support
Added the new
ExecuteInterporatedStringHandlerref struct and related types (SqliteParam,SqlitePramKind,SqlitePramPayload) insrc/CsSqlite/ExecuteInterporatedStringHandler.cs, enabling efficient and type-safe parameter handling for SQL commands using interpolated strings.Extended
SqliteConnectionwith new overloads forExecuteNonQueryandExecuteReaderthat accept the interpolated string handler, automatically binding parameters based on their types (string, UTF-8 string, integer, double).Example