Skip to content

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.

@netlify
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

@codspeed-hq
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