File tree 2 files changed +8
-5
lines changed
2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -6,28 +6,31 @@ open RepoDb
6
6
open RepoDb.Extensions
7
7
open FSharpRepoDB.Types
8
8
9
- let url ( argv : string array ) =
9
+ let getUrl ( argv : string array ) =
10
10
let getFromEnv =
11
11
System.Environment.GetEnvironmentVariable( " MSSQL_DB_URL" )
12
12
|> Option.ofObj
13
13
14
14
let fromArgsOrEnv =
15
15
argv
16
- |> Array.tryFind( fun arg -> arg.Contains " --dburl= " )
17
- |> Option.map ( fun f -> f.Split( '= ' ) |> Seq.tryLast)
16
+ |> Array.tryFind( fun arg -> arg.Contains " --dburl~ " )
17
+ |> Option.map ( fun f -> f.Split( '~ ' ) |> Seq.tryLast)
18
18
|> Option.flatten
19
19
|> Option.orElse getFromEnv
20
20
21
- fromArgsOrEnv |> Option.defaultValue " Server=127.0.0.1 ;Database=TestDB;User Id=sa;Password=Password1! ;"
21
+ fromArgsOrEnv |> Option.defaultValue " Server=. ;Database=TestDB;Integrated Security=SSPI ;"
22
22
23
23
[<EntryPoint>]
24
24
let main argv =
25
+ // you can set "MSSQL_DB_URL" env variable or run the following command to use a Custom URL for testing purposes
26
+ /// dotnet run -p FSharpRepoDB -- "--dburl~Server=127.0.0.1;Database=TestDB;User Id=sa;Password=Password1!;"
25
27
26
28
// Initialize the SQL Server
27
29
SqlServerBootstrap.Initialize()
28
30
29
31
// Open the connection
30
- let connection = ( new SqlConnection( url argv)) .EnsureOpen()
32
+ let url = getUrl argv
33
+ let connection = ( new SqlConnection( url)) .EnsureOpen()
31
34
32
35
// Get the fields
33
36
let personType = typedefof< Person>
You can’t perform that action at this time.
0 commit comments