Prompt for calling the method of connecting to the database #2826
Replies: 5 comments 2 replies
-
There's not a lot we can do to help without knowing a lot more about your code. Either way, you can't call |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
query database method: pub fn db_query_r(conf: &mut Dbcfg, command_text: &str) -> Vec<Row> {
let mut client = db_connect(conf).unwrap();
let rt = db_query(&mut client, command_text).unwrap();
rt
} |
Beta Was this translation helpful? Give feedback.
-
postgres="0.19.2" yeah! pub fn db_query(client: &mut Client, command_text: &str) -> Result<Vec<Row>, Error> {
let rt = client.query(command_text, &[]);
rt
} |
Beta Was this translation helpful? Give feedback.
-
async/await, i see. thinks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
actix-rt|system:0|arbiter:0' panicked at 'Cannot start a runtime from within a runtime. This happens because a function (like
block_on
) attempted to block the current thread while the thread is being used to drive asynchronous tasksBeta Was this translation helpful? Give feedback.
All reactions