Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add savepoint method to Transaction#184

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sfackler merged 2 commits intorust-postgres:masterfromnvb:nvanbenschoten/savepoints
May 27, 2016

Conversation

nvb
Copy link
Contributor

@nvbnvb commentedMay 25, 2016

Fixes#179

This change creates aTransaction.savepoint method, which is equivalent
toTransaction.transaction, but takes a custom name for the nested
transaction's savepoint name.

This change creates a `Transaction.savepoint` method, which is equivalentto `Transaction.transaction`, but takes a custom name for the nestedtransaction's savepoint name.
pubstructTransaction<'conn>{
conn:&'connConnection,
depth:u32,
savepoint_name:Option<&'connstr>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'd just make this anOption<String> - the runtime cost of the allocation is ~0 compared to talking over the network.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sounds good to me. How's that?

I'll squash the commits down to one if/when this PR gets the thumbs up by the way.

@sfackler
Copy link
Collaborator

👍 Thanks!

@sfacklersfackler merged commit616b725 intorust-postgres:masterMay 27, 2016
@nvbnvb deleted the nvanbenschoten/savepoints branchMay 27, 2016 04:21
@nvb
Copy link
ContributorAuthor

nvb commentedMay 1, 2020

Hi@sfackler! I noticed that this functionality was lost in the newest release (0.17). Was that intentional? E.g. did you decide that this was bloating the API? Or was it just lost in the Tokio rewrite and missed in0d3e18b? If the latter, do you mind if I send a patch to add it back in?

For context, CockroachDB is still very interested in this functionality for the same reason as we originally discussed in#179. This client-side retry pattern is documentedin the CRDB docs and we'd love to be able to get people onto the newest version of this library. This is especially true because we've seen an uptick in people using Rust with CRDB recently (including me on a few side projects 😃) and also an uptick in people interested in Tokio + async/await.

@sfackler
Copy link
Collaborator

Oops - the removal was an oversight during the big rewrite. Happy to take a PR adding it back, or I can put one up at some point alternatively.

@nvb
Copy link
ContributorAuthor

nvb commentedMay 1, 2020

Great! I'll try to get a PR out for this today.

nvb added a commit to nvb/rust-postgres that referenced this pull requestMay 1, 2020
Revivesrust-postgres#184.The rewrite for async/await and Tokio accidentally lost functionalitythat allowed users to assign specific names to savepoints when usingnested transactions. This functionality had originally been addedinrust-postgres#184 and had been updated inrust-postgres#374.This commit revives this functionality using a similar scheme to theone that existed before. This should allow CockroachDB users to updateto the next patch release of version `0.17`.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Custom savepoint names for subtransactions

2 participants

@nvb@sfackler

[8]ページ先頭

©2009-2025 Movatter.jp