Skip to content
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

sql-query-connector: take trace ids by reference #3571

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

tomhoule
Copy link
Contributor

@tomhoule tomhoule commented Jan 6, 2023

This commit is limited to sql-query-connector, it should not interfere with #3505.

In general, we do not need ownership of the trace id in sql-query-connector, since we only re-render it in comments. Working with a reference is easier (it ii Copy, etc.), and it already saves us string copies and allocations with this commit.

The other purpose of this PR is that we discussed yesterday about introducing a QueryContext<'_> type struct to hold things like the trace id and connection info. Experience from designing similar context structs in the schema team showed it is much easier to do if everything in the context can be a reference.

On the side, I could not resist making a few public items crate-public, to make the public surface of the crate smaller and clearer.

@tomhoule tomhoule added this to the 4.9.0 milestone Jan 6, 2023
@tomhoule tomhoule requested a review from Weakky January 6, 2023 07:51
@tomhoule tomhoule marked this pull request as ready for review January 6, 2023 07:51
This commit is limited to sql-query-connector, it should not interfere
with #3505.

In general, we do not need ownership of the trace id in
sql-query-connector, since we only re-render it in comments. Working
with a reference is easier (it ii `Copy`, etc.), and it already saves us
string copies and allocations with this commit.

The other purpose of this PR is that we discussed yesterday about
introducing a `QueryContext<'_>` type struct to hold things like the
trace id and connection info. Experience from designing similar context
structs in the schema team showed it is much easier to do if everything
in the context can be a reference.

On the side, I could not resist making a few public items crate-public,
to make the public surface of the crate smaller and clearer.
@tomhoule tomhoule force-pushed the sql-query-connector-context branch from ad36b5f to 4986f7a Compare January 6, 2023 08:28
@tomhoule tomhoule merged commit effe555 into main Jan 6, 2023
@tomhoule tomhoule deleted the sql-query-connector-context branch January 6, 2023 14:11
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