-
Notifications
You must be signed in to change notification settings - Fork 1.3k
sqlite: Fix missing ProgrammingError for parameter mismatch #6104
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
sqlite: Fix missing ProgrammingError for parameter mismatch #6104
Conversation
WalkthroughAdds bind-parameter-count validation to the Python sqlite3 wrapper: new Statement helper to query bind parameter count, early checks in Cursor.execute, and updated binding-sequence validation with clearer ProgrammingError messages. No public API signature changes. (43 words) Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor PyCode as Python
participant Cursor
participant Statement
participant SQLite
PyCode->>Cursor: execute(sql, params?)
Cursor->>Statement: prepare(sql)
Cursor->>Statement: bind_parameter_count()
Statement-->>Cursor: count
alt no params supplied and count > 0
Cursor-->>PyCode: ProgrammingError("uses {count}, and 0 were supplied")
else params supplied
Cursor->>Cursor: compare supplied_count vs count
alt mismatch
Cursor-->>PyCode: ProgrammingError("uses {count}, and {supplied} were supplied")
else match
Cursor->>Statement: bind(params)
Statement->>SQLite: step()/execute
SQLite-->>Cursor: result
Cursor-->>PyCode: result/rows
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: .coderabbit.yml 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
9722338
to
36a0499
Compare
36a0499
to
a47ba75
Compare
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.
👍
ref
Summary by CodeRabbit