0xMiden / 0xMiden/rust-sdk

SQL store hardening - Errors

Open
#2,350 0 comments 0 reactions 0 assignees View on GitHub
store
Dominant language
Rust
Stars
78
Forks
129
Avg merge
4d 14h
Merged PRs (30d)
52

Description

* **Expose structured SQL failures.** Callers currently receive opaque strings and cannot distinguish retryable lock contention from corruption.
* Add variants for busy or locked databases.
* Add a constraint-violation variant.
* Add a corruption variant.
* **Make settings row-count failures consistent.** `set_setting` and `remove_setting` currently panic in debug builds and silently continue in release builds.
* Return an error when the affected row count is not one.

Contributor guide

Open the contributing guide

Research direction

Look at the SQL store implementation, likely in a module like `store/sql.rs` or similar. Examine how errors are currently returned as strings and identify where SQL operations (like setting/removing settings) are performed. The goal is to define new error variants (e.g., `SqlError::Busy`, `SqlError::ConstraintViolation`) and replace panics with proper error returns. Check for existing tests around SQL operations to understand the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, databases
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.