Initial commit SqlConnector (also added reference to Mono.Data.Sqlite).

This commit is contained in:
Achim D. Brucker 2017-08-07 08:43:50 +01:00
parent 0db303a192
commit 50187bcdec
3 changed files with 44 additions and 18 deletions

View File

@ -1,16 +0,0 @@
namespace LogicalHacking.ExtensionDsLab
/// Documentation for my library
///
/// ## Example
///
/// let h = Library.hello 1
/// printfn "%d" h
///
module Library =
/// Returns 42
///
/// ## Parameters
/// - `num` - whatever
let hello num = 42

View File

@ -44,7 +44,7 @@
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<PropertyGroup Condition="('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
</Otherwise>
@ -68,8 +68,11 @@
</When>
</Choose>
<Import Project="..\..\.paket\paket.targets" />
<ItemGroup Condition="Not Exists('$(MSBuildExtensionsPath32)')">
<Reference Include="Mono.Data.Sqlite" />
</ItemGroup>
<ItemGroup>
<Compile Include="Library.fs" />
<Compile Include="SqlConnector.fs" />
<None Include="paket.references" />
<None Include="paket.template" />
<Content Include="Google.DataTable.Net.Wrapper.XML">

View File

@ -0,0 +1,39 @@
(*
* This file is part of the ExtensionDsLab project.
* Copyright (c) 2017 LogicalHacking.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*)
namespace Logicalhacking.ExtensionDsLab.Data
open FSharp.Data.Sql
module SqlConnector =
let [<Literal>] DevelopmentDB = "aa-ac.sqlite"
let [<Literal>] FullDB = "full.sqlite"
let [<Literal>] DatabaseDir = "archive/db"
// static (compile time) ConnectionString
let [<Literal>] ConnectionString = @"Data Source="
+ __SOURCE_DIRECTORY__
+ @"/../.."
+ @"/" + DatabaseDir
+ @"/" + DevelopmentDB + @";Version=3"
// create a type alias with the connection string and database vendor settings
type Sql = SqlDataProvider<
ConnectionString = ConnectionString,
DatabaseVendor = Common.DatabaseProviderTypes.SQLITE,
// ResolutionPath = ResolutionPath,
IndividualsAmount = 500,
UseOptionTypes = true >