You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm writing a generic database helper app, and I would like to find a way to convert whatever table entries into a vec<vec> type.
Been reading around trying to find how but I can't figure it out.
Right now I am creating a connection and doing xsql::query("select * from x").fetch_all(connection).await. I understand that usually this command is paired with a struct with derived fromRow, but I will never know what table I am actually querying during runtime, so I cannot do that. I read a few posts about how to create ones own FromRow implementation, but I don't need to map it to struct fields. Just the raw data in vec2 form.
I would also like to know how I can parse the query DESCRIBE table. The only way I found right now involves knowing the database name, which I don't during runtime.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm writing a generic database helper app, and I would like to find a way to convert whatever table entries into a vec<vec> type.
Been reading around trying to find how but I can't figure it out.
Right now I am creating a connection and doing
xsql::query("select * from x").fetch_all(connection).await
. I understand that usually this command is paired with a struct with derived fromRow, but I will never know what table I am actually querying during runtime, so I cannot do that. I read a few posts about how to create ones own FromRow implementation, but I don't need to map it to struct fields. Just the raw data in vec2 form.I would also like to know how I can parse the query
DESCRIBE table
. The only way I found right now involves knowing the database name, which I don't during runtime.How could I do this, is it possible? If not why? With the no knowledge I have it feels like that would be an easy function to provide.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions