Initial commit

This commit is contained in:
2021-10-23 19:59:20 +10:00
commit ba4c9a7d7a
1851 changed files with 1250444 additions and 0 deletions

35
Database.module.fs Normal file
View File

@@ -0,0 +1,35 @@
module db
open Dapper.FSharp.MySQL
open MySql.Data.MySqlClient
open DredgeFramework
let connString = "server=localhost;uid=root;pwd=;database=dredgepos;table cache = false"
let connection = new MySqlConnection(connString)
let Select<'a> asyncQuery =
asyncQuery
|> connection.SelectAsync<'a>
|> RunSynchronously
|> EnumerableToArray
let SelectJoin<'a, 'b> asyncQuery =
asyncQuery
|> connection.SelectAsync<'a, 'b>
|> RunSynchronously
|> EnumerableToArray
let Insert<'a> asyncQuery =
asyncQuery
|> connection.InsertAsync<'a>
|> RunSynchronously
let Update<'a> asyncQuery =
asyncQuery
|> connection.UpdateAsync<'a>
|> RunSynchronously
let Delete<'a> asyncQuery =
asyncQuery
|> connection.DeleteAsync
|> RunSynchronously