use sqlx::SqlitePool; pub struct UserTrip {} impl UserTrip { pub async fn create(db: &SqlitePool, user_id: i64, trip_details_id: i64) -> bool { sqlx::query!( "INSERT INTO user_trip (user_id, trip_details_id) VALUES(?, ?)", user_id, trip_details_id ) .execute(db) .await .is_ok() } pub async fn delete(db: &SqlitePool, user_id: i64, trip_details_id: i64) { let _ = sqlx::query!( "DELETE FROM user_trip WHERE user_id = ? AND trip_details_id = ?", user_id, trip_details_id ) .execute(db) .await .is_ok(); } }