@ -46,6 +46,24 @@ WHERE id like ?
|
||||
.ok()
|
||||
}
|
||||
|
||||
pub async fn find_by_startingdatetime(
|
||||
db: &SqlitePool,
|
||||
day: String,
|
||||
planned_starting_time: String,
|
||||
) -> Vec<Self> {
|
||||
sqlx::query_as!(
|
||||
Self,
|
||||
"
|
||||
SELECT id, planned_starting_time, max_people, day, notes, allow_guests, trip_type_id, always_show, is_locked
|
||||
FROM trip_details
|
||||
WHERE day = ? AND planned_starting_time = ?
|
||||
"
|
||||
, day, planned_starting_time
|
||||
)
|
||||
.fetch_all(db)
|
||||
.await.unwrap()
|
||||
}
|
||||
|
||||
/// Creates a new entry in `trip_details` and returns its id.
|
||||
pub async fn create(db: &SqlitePool, tripdetails: TripDetailsToAdd<'_>) -> i64 {
|
||||
let query = sqlx::query!(
|
||||
|
Reference in New Issue
Block a user