Replies: 4 comments 3 replies
-
I've converted this to a discussion as this is not a bug report but a support question. Our issue tracker is reserved for actual bug reports, so please don't fill support questions there again.
If you want an
That's on purpose. Error types in rust are often not
I'm sorry but that's again on purpose I we don't want to commit to stability for these interfaces. This won't change just because you feel that it should be stable. Stabilizing these kind of interfaces likely requires a lot of work to stabilize potentially wanted language features. As for the number of traits: Again that's on purpose as we need this granularity to support all the different features we want to support with diesel. That all written: I'm not sure if you really want to even have a custom connection implementation for this or if it wouldn't be much easier to just have a single free standing function that is called before |
Beta Was this translation helpful? Give feedback.
-
The async connection part looks helpful! Thanks for pointing that out :). I haven’t been a Rust developer long enough to know whether what you say about errors and cloning makes sense. I only know that I can’t remember hitting another error handling issue like this elsewhere. It smells off to me, but I may be wrong. Thanks for the feedback overall, it’s much appreciated. I’ll think about whether this should be implemented before the connection is built rather than after. But if it’s before, then every project has to be updated individually rather than just providing a new connection driver. |
Beta Was this translation helpful? Give feedback.
-
Generating auth tokens is a CPU bound task. You don't need it to be async. |
Beta Was this translation helpful? Give feedback.
-
This seems reasonable to me, I've let the team know. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Setup
Versions
Feature Flags
postgres
,i-implement-a-third-party-backend-and-opt-into-breaking-changes
Problem Description
I hit a couple annoying API issues with the diesel Connection traits while creating a wrapper for DSQL around the built-in Postgresql connection type. I'm raising these concerns together as a single issue, but I'm happy to fork them to separate issues if the maintainers find them to be valid and want to deal with them separately. None of these are show-stoppers, they just made it "annoying" to implement.
I may also be implementing this at the wrong layer of the stack. If so, please provide guidance and I'll happily close this issue!
What are you trying to accomplish?
I wanted to play with DSQL for a side project that already uses Postgresql. FWIW, after removing foreign key constraints, Diesel seemed to "just work" once I got my connection driver working. I added this code directly to my side project, but I assume a production-ready version should exist as a separate crate.
What issues were found?
i-implement-a-third-party-backend-and-opt-into-breaking-changes
feature flag. All this does is transform one connection string into a postgresql connection string. The breaking-changes feature flag concerns me most.Steps to reproduce
You can find my code at this gist. See line 96 for annoyance in handling ConnectionError without Clone. Search for
thread
to find the two places we need to perform asynchronous processing to generate a postgres connection string.Checklist
Beta Was this translation helpful? Give feedback.
All reactions