Insert data into the database table `customer_details`.
(
conn: &mut mysql::PooledConn,
my_customer_name: String,
my_branch_name: String,
)
| 238 | |
| 239 | /// Insert data into the database table `customer_details`. |
| 240 | fn insert_customer_data( |
| 241 | conn: &mut mysql::PooledConn, |
| 242 | my_customer_name: String, |
| 243 | my_branch_name: String, |
| 244 | ) -> mysql::error::Result<u64> { |
| 245 | conn.exec_drop( |
| 246 | r" |
| 247 | INSERT INTO customer_details (customer_name, branch_name) |
| 248 | VALUES (:customer_name, :branch_name) |
| 249 | ", |
| 250 | params! { |
| 251 | "customer_name" => my_customer_name, |
| 252 | "branch_name" => my_branch_name, |
| 253 | }, |
| 254 | ) |
| 255 | .map(|_| conn.last_insert_id()) |
| 256 | } |
| 257 | |
| 258 | /// Lists all banks' details. |
| 259 | fn select_bank_details(conn: &mut mysql::PooledConn) -> mysql::error::Result<Vec<BankDetails>> { |