Skip to content

fix: include parameter context in SQLite binding errors - #314

Merged
chrispader merged 2 commits into
margelo:mainfrom
huytdps13400:fix/309-check-bind-errors
Oct 1, 2026
Merged

chrispader merged 2 commits into
margelo:mainfrom
huytdps13400:fix/309-check-bind-errors

Conversation

@huytdps13400

@huytdps13400 huytdps13400 commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

SQLite binding errors currently omit the parameter index and numeric error code, which makes invalid parameter lists harder to diagnose. The core bind-status checks already landed on main in #294. This PR adds the remaining error context to the shared binder without including parameter values.

Omitted placeholders still bind as SQL NULL, so an exact parameter count is not required. The guide and public parameter type document this behavior. Regression coverage includes sync and async execution, batches, grouped batch rollback, and reusable prepared statements.

Reproduction

Execute SELECT ? with two parameter values. The operation must throw or reject with parameter 2, SQLite error 25, and column index out of range, without exposing the extra value. Repeat through a prepared statement or a batch; a correctly sized parameter list should still succeed afterward.

Fixes #309.

Check every sqlite3_bind result and reject invalid parameter indexes across sync, async, and batch APIs. Closes margelo#309.
@chrispader chrispader added bug Incorrect behavior or a change that fixes it. area:runtime Database lifecycle, SQL execution, transactions, or native runtime. labels Sep 29, 2026
@vercel

vercel Bot commented Oct 1, 2026

Copy link
Copy Markdown

@chrispader is attempting to deploy a commit to the Margelo Team on Vercel.

A member of the Team first needs to authorize it.

@chrispader chrispader changed the title fix: surface SQLite parameter binding errors fix: include parameter context in SQLite binding errors Oct 1, 2026
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-nitro-sqlite Ready Ready Preview Oct 1, 2026 10:04am UTC

Request Review

@chrispader

Copy link
Copy Markdown
Member

Thanks for the PR @huytdps13400 ! 🙌🏼

@chrispader
chrispader merged commit 2cc28d5 into margelo:main Oct 1, 2026
11 of 15 checks passed

This branch was successfully deployed

1 active deployment
Preview — 9edeb1b4 Deployed Oct 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:runtime Database lifecycle, SQL execution, transactions, or native runtime. bug Incorrect behavior or a change that fixes it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check sqlite3_bind return codes so extra parameters are not silently ignored

2 participants