Adding dependencies

First, we have to add dependencies to establish a connection to MySQL. We use all the same dependencies as in the previous example, but have replaced postgres with the mysql crate, and r2d2_postgres with the r2d2_mysql crate:

mysql = "14.1"
r2d2_mysql = "9.0"

We still need the csv, rayon, r2d2, and serde family crates.

You also have to declare other types to use them in the code, as follows:

use mysql::{Conn, Error, Opts, OptsBuilder};
use r2d2_mysql::MysqlConnectionManager;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.68.28