Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Report a bug. #312

lmmqxyx404 started this conversation in General
Oct 26, 2022 · 1 comments · 1 reply
Discussion options

extern crate rbatis;

use rbdc_mysql::driver::MysqlDriver;
#[tokio::main]
async fn main() {
    // println!("Hello, world!");
    let rb = rbatis::Rbatis::new();
    let res = rb.init(MysqlDriver {}, "mysql://root:admin@localhost:13308/test");
    if res.is_ok() {
        println!("Hello, world!");
    } else {
        println!("failed");
    }
}

The database_url is wrong. but the code could also run.
There may be a bug with the function init()

You must be logged in to vote

Replies: 1 comment · 1 reply

Comment options

extern crate rbatis;

use rbdc_mysql::driver::MysqlDriver;
#[tokio::main]
async fn main() {
    // println!("Hello, world!");
    let rb = rbatis::Rbatis::new();
    let res = rb.init(MysqlDriver {}, "mysql://root:admin@localhost:13308/test");
    if res.is_ok() {
        println!("Hello, world!");
    } else {
        println!("failed");
    }
}

The database_url is wrong. but the code could also run. There may be a bug with the function init()

you must use rb.link() replace rb.init()
check database url must call method init method and than call rb.try_acquire().await?;

You must be logged in to vote
1 reply
@lmmqxyx404
Comment options

Thanks a lot.Your suggestion works well.
But in my opinion, such a design is incomprehensible.
The intuitive understanding of init() should be a Result(successful ,failed).
I do sincerely feel that the previous design( link()) is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
2 participants
Converted from issue

This discussion was converted from issue #311 on October 27, 2022 01:43.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.