Skip to content

feat: Make attach pub #832

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged

Conversation

MichaReiser
Copy link
Contributor

It's sometimes necessary to print salsa data outside a query. However, the output isn't very useful without a db attached
and salsa currently doesn't expose an API to attach the db.

This PR makes attach::attach pub, so that user-code can attach a database when necessary.

My specific use case is that I want to print a salsa::Backtrace that was captured earlier but the handler
isn't part of any salsa query.

Alternatives: We could add a Backtrace::display method that accepts a specific db.

Downsides: This exposes that each db is associated with a single thread. I think this
is something that's already observable to users anyway.

Copy link

netlify bot commented Apr 30, 2025

Deploy Preview for salsa-rs canceled.

Name Link
🔨 Latest commit 37d5e5e
🔍 Latest deploy log https://app.netlify.com/sites/salsa-rs/deploys/6811cdeee28d670008c438ad

Copy link

codspeed-hq bot commented Apr 30, 2025

CodSpeed Performance Report

Merging #832 will not alter performance

Comparing MichaReiser:make-attach-pub (37d5e5e) with master (af811a3)

Summary

✅ 12 untouched benchmarks

@Veykril Veykril added this pull request to the merge queue Apr 30, 2025
Merged via the queue into salsa-rs:master with commit 79afd59 Apr 30, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request Apr 30, 2025
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