Test Push

This commit is contained in:
2021-11-09 22:11:39 +10:00
parent c236e8a89a
commit cbec4a5c5c
18 changed files with 124 additions and 92 deletions

View File

@@ -1 +1,26 @@
module GenericEntities
module Entity
open DredgePos
open Types
open Dapper.FSharp
open DredgeFramework
let getDatabaseTable (record: 'a) = record.GetType().ToString().ToLower() + "s"
let addToDatabase (record: 'x)=
let tableName = getDatabaseTable record
insert {
table tableName
value record
}
|> db.InsertOutput
|> first
let updateInDatabase (record: 'x) =
let tableName = getDatabaseTable record
(* Run an update query *)
update {
table tableName
set record
}
|> db.Update |> ignore
record