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

Function insert_bank_data

databases/mysql/src/persistence.rs:183–199  ·  view source on GitHub ↗

Insert data into the database table `bank_details`.

(
    conn: &mut mysql::PooledConn,
    my_bank_name: String,
    my_country: String,
)

Source from the content-addressed store, hash-verified

181
182/// Insert data into the database table `bank_details`.
183fn insert_bank_data(
184 conn: &mut mysql::PooledConn,
185 my_bank_name: String,
186 my_country: String,
187) -> mysql::error::Result<u64> {
188 conn.exec_drop(
189 "
190 INSERT INTO bank_details (bank_name, country)
191 VALUES (:bank_name, :country)
192 ",
193 params! {
194 "bank_name" => my_bank_name,
195 "country" => my_country,
196 },
197 )
198 .map(|_| conn.last_insert_id())
199}
200
201/// Insert data into the database table `branch_details`.
202fn insert_branch_data(

Callers 1

create_bankFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected