MCPcopy Create free account
hub / github.com/actix/examples / insert_customer_data

Function insert_customer_data

databases/mysql/src/persistence.rs:240–256  ·  view source on GitHub ↗

Insert data into the database table `customer_details`.

(
    conn: &mut mysql::PooledConn,
    my_customer_name: String,
    my_branch_name: String,
)

Source from the content-addressed store, hash-verified

238
239/// Insert data into the database table `customer_details`.
240fn 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.
259fn select_bank_details(conn: &mut mysql::PooledConn) -> mysql::error::Result<Vec<BankDetails>> {

Callers 1

create_customerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected