Initial commit
This commit is contained in:
28
Reservations.module.fs
Normal file
28
Reservations.module.fs
Normal file
@@ -0,0 +1,28 @@
|
||||
module Reservations
|
||||
|
||||
open System
|
||||
open DredgeFramework
|
||||
open Dapper.FSharp
|
||||
|
||||
type reservation = {
|
||||
reservation_id: int
|
||||
reservation_name: string
|
||||
reservation_time: int
|
||||
reservation_covers: int
|
||||
reservation_table_id: int
|
||||
reservation_created_at: int
|
||||
}
|
||||
|
||||
let GetReservationById (id: int) =
|
||||
select {
|
||||
table "reservations"
|
||||
where (eq "reservation_id" id)
|
||||
}
|
||||
|> db.Select<reservation>
|
||||
|> first
|
||||
|
||||
let DeleteReservation (tableId: int) =
|
||||
delete {
|
||||
table "reservations"
|
||||
where (eq "table_id" tableId)
|
||||
} |> db.Delete |> ignore
|
||||
Reference in New Issue
Block a user