Skip to content

Instantly share code, notes, and snippets.

@altaurog
Last active Feb 3, 2020
Embed
What would you like to do?
Error using SQLProvider
version: '2'
services:
sqlprovider-test:
build: ./
command: bash -c "while ! nc -z mssql 1433; do echo waiting; sleep 1; done; sleep 10; dotnet build --verbosity detailed"
container_name: sqlprovider-test
depends_on:
- mssql
mssql:
image: mcr.microsoft.com/mssql/server:2017-latest
environment:
- ACCEPT_EULA=Y
- SA_PASSWORD=NeOk2-sleif
FROM mcr.microsoft.com/dotnet/core/sdk:3.1
RUN apt-get update && apt-get install -y netcat
COPY Test.fsproj Program.fs /Test/
WORKDIR /Test
RUN dotnet restore # --verbosity detailed
open FSharp.Data.Sql
type sql =
SqlDataProvider<
DatabaseVendor = Common.DatabaseProviderTypes.MSSQLSERVER,
ConnectionString = "Server=mssql;User Id=sa;Password=NeOk2-sleif;Database=master",
UseOptionTypes = true,
Owner = "Master"
>
let ctx = sql.GetDataContext()
[<EntryPoint>]
let main argv = 0
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
<ItemGroup>
</ItemGroup>
<ItemGroup>
<PackageReference Include="SQLProvider" Version="1.1.59" />
</ItemGroup>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment