-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat: ToSql
trait
#33
Comments
seems like i can just use |
Yeah, the idea behind |
gotcha. i initially opened this issue when i was looking at implementing a connector for this library in axum-login, but now, i'm having trouble going the other way - from a for reference, here's my current attempt: fn from_db_row(row: libsql_client::Row) -> Result<Self, Errors> {
let id: Uuid = row // (Row)
.try_column::<String>("id") // Result<String, Error>
.map_err(Errors::DbStoredUuidParsingError) // Result<String, Errors>
.map(|v: String| Uuid::parse_str(v.as_str())) // Result<Result<Uuid, Error>, Errors>
.unwrap() // Result<Uuid, Errors>
.unwrap(); // Uuid
// ... but this gives me:
and i get the same thing if i don't specify the type for |
this seems to have worked for me.
which i found in the turso docs |
implementations by other libraries for reference:
having a trait would be helpful in order to clarify which types can be passed to
args!
, and would make the crate more extensibleideally would also implement this trait for commonly used types
The text was updated successfully, but these errors were encountered: