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

context cannot be passed to DbMap.Begin #437

Open
MisterSquishy opened this issue Dec 21, 2022 · 0 comments · May be fixed by #438
Open

context cannot be passed to DbMap.Begin #437

MisterSquishy opened this issue Dec 21, 2022 · 0 comments · May be fixed by #438

Comments

@MisterSquishy
Copy link

Because DbMap.WithContext returns a SqlExecutor (not a DbMap), it is impossible to set the context on a DbMap without transforming it into a SqlExecutor. This becomes problematic when you want to do something like DbMap.Begin, which is only defined on DbMap and not SqlExecutor.

in practice, this means that DbMap.Begin cannot use an existing context, which means it cannot respect deadlines, which is a real bummer when your connection pool is exhausted 😞

at first glance it seems that WithContext oughta return a DbMap; am I misreading something?

@MisterSquishy MisterSquishy linked a pull request Dec 27, 2022 that will close this issue
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 a pull request may close this issue.

1 participant