Improved static database setup.
This commit is contained in:
parent
321b9e9c38
commit
c0065af78f
25
example.fsx
25
example.fsx
|
@ -1,19 +1,25 @@
|
||||||
// reference the type provider dll
|
// reference the type provider dll
|
||||||
#r "./packages/SQLProvider/lib/FSharp.Data.SqlProvider.dll"
|
|
||||||
open FSharp.Data.Sql
|
|
||||||
|
|
||||||
|
#r @"Mono.Data.Sqlite.dll"
|
||||||
|
#r @"./packages/SQLProvider/lib/FSharp.Data.SqlProvider.dll"
|
||||||
|
open FSharp.Data.Sql
|
||||||
|
open System.IO
|
||||||
|
let (+/) path1 path2 = Path.Combine(path1, path2)
|
||||||
|
|
||||||
|
let [<Literal>] DevelopmentDB = "aa-ac.sqlite"
|
||||||
|
let [<Literal>] FullDB = "full.sqlite"
|
||||||
|
let [<Literal>] DatabaseDir = "archive/db"
|
||||||
// static (compile time) ResolutionPath and ConnectionString
|
// static (compile time) ResolutionPath and ConnectionString
|
||||||
let [<Literal>] ResolutionPath = __SOURCE_DIRECTORY__ + @"/lib"
|
let [<Literal>] ResolutionPath = __SOURCE_DIRECTORY__ + @"/lib"
|
||||||
let [<Literal>] ConnectionString = "Data Source="
|
let [<Literal>] ConnectionString = @"Data Source="
|
||||||
+ __SOURCE_DIRECTORY__ + @"/data/extensions.sqlite;Version=3"
|
+ __SOURCE_DIRECTORY__
|
||||||
|
+ @"/" + DatabaseDir
|
||||||
|
+ @"/" + DevelopmentDB + @";Version=3"
|
||||||
|
|
||||||
// create a type alias with the connection string and database vendor settings
|
// create a type alias with the connection string and database vendor settings
|
||||||
type Sql = SqlDataProvider<
|
type Sql = SqlDataProvider<
|
||||||
ConnectionString = ConnectionString,
|
ConnectionString = ConnectionString,
|
||||||
DatabaseVendor = Common.DatabaseProviderTypes.SQLITE,
|
DatabaseVendor = Common.DatabaseProviderTypes.SQLITE,
|
||||||
ResolutionPath = ResolutionPath,
|
// ResolutionPath = ResolutionPath,
|
||||||
IndividualsAmount = 500,
|
IndividualsAmount = 500,
|
||||||
UseOptionTypes = true >
|
UseOptionTypes = true >
|
||||||
|
|
||||||
|
@ -28,7 +34,7 @@ let getDownloads extid = query {
|
||||||
download.Value))
|
download.Value))
|
||||||
|> Seq.toArray
|
|> Seq.toArray
|
||||||
|
|
||||||
let customers =
|
let exts =
|
||||||
Ctx.Main.Extension
|
Ctx.Main.Extension
|
||||||
|> Seq.map(fun c -> c.Extid)
|
|> Seq.map(fun c -> c.Extid)
|
||||||
|> Seq.toList
|
|> Seq.toList
|
||||||
|
@ -54,4 +60,3 @@ let ExtIds = ["aaagbdompnfgjaokopkpaceijcapjdde"
|
||||||
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|
|> Chart.WithOptions (Options(legend=Legend(position="bottom")))
|
||||||
|> Chart.WithLabels ExtIds
|
|> Chart.WithLabels ExtIds
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue