Fix sqlite3 cursor and placeholder syntax in get_row_from_db (#895)#907
Open
harminius wants to merge 3 commits into
Open
Fix sqlite3 cursor and placeholder syntax in get_row_from_db (#895)#907harminius wants to merge 3 commits into
harminius wants to merge 3 commits into
Conversation
Contributor
|
@harminius does this mean this was never working? also I do not see using context manager with connection object - would be good to review gpkg handling here and wrap it up |
Contributor
Author
|
@varmar05 As of context manages
|
Contributor
Author
|
unlike the I would prefer not to worry about its lifecycle and use the shortcut https://docs.python.org/3/library/sqlite3.html#sqlite3-connection-shortcuts |
varmar05
approved these changes
May 15, 2026
Contributor
Author
|
Closing the SQL connection might fix this dinosaur: #473 |
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.
Summary
Fixes #895 — clicking a version in the Changes viewer raised:
get_row_from_dbinMergin/diff.pywas written with psycopg2 conventions even thoughdb_connis a stdlibsqlite3.Connection:with db_conn.cursor() as c:—sqlite3.Cursoris not a context manager (onlysqlite3.Connectionis).'"{}" = %s'placeholders —sqlite3uses?, not%s.Changes
withwrapper; assign cursor directly%s→?for parameter placeholders.