Prompt for calling the method of connecting to the database #2826
Unanswered
bouyeijiang
asked this question in
Q&A
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 |
0 replies
|
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
} |
1 reply
|
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
} |
1 reply
|
async/await, i see. thinks! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

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 tasksAll reactions