Skip to content

Conversation

@karambarakat
Copy link
Contributor

@karambarakat karambarakat commented Jan 9, 2025

Row::get should track caller for a better development experience.

the reason for that is that if I have a code like this

my_file.rs

10 |    row.get("non_existing_col")

I would get error message like

thread panicked at 
/../sqlx-core-0.7.4/src/row.rs:72:37:
called `Result::unwrap()` on an `Err` value: ColumnNotFound("non_existing_col")

if I have #[track_caller] I would get error like:

thread panicked at 
/../my_crate/src/my_file.rs:10:37:
called `Result::unwrap()` on an `Err` value: ColumnNotFound("non_existing_col")

Which helps debugging because backtraces are difficult to deal with and are disabled by default in rust.

Does your PR solve an issue?

no, as far as my search

Row::get should track caller for a better development experience.
@abonander abonander changed the title Update row.rs add #[track_caller] to Row::get() Jan 9, 2025
@abonander abonander merged commit b386862 into launchbadge:main Jan 13, 2025
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants