Questions tagged [fsharp.data.sqlclient]

FSharp.Data.SqlClient is a family of F# Type Providers facilitating statically typed access to input parameters and result sets of T-SQL commands in idiomatic F# way

The library is a home for three type providers:

  • SqlCommandProvider - type-safe access to full set of T-SQL language
  • SqlProgrammabilityProvider - quick access to Sql Server functions and stored procedures in idiomatic F# way
  • SqlEnumProvider - generates .NET Enums based on static lookup data from any ADO.NET complaint source
30 questions
14
votes
3 answers

How to use SQL IN statement in fsharp.data.sqlclient?

I have the following sample code. The objective is to run SQL statement with multiple input parameters. [] let connectionString = @"Data Source=Localhost;Initial Catalog=Instrument;Integrated Security=True" [] let query = "SELECT…
zyzhu
  • 266
  • 2
  • 7
8
votes
1 answer

Using connectionstring from app.config with FSharp.Data.SqlClient

I'm using FSharp.Data.SqlClient and trying to move my connectionString from a [] to the app.config. My app.config looks like this
Snæbjørn
  • 10,322
  • 14
  • 65
  • 124
4
votes
1 answer

F# filtering records with many option types

Okay, strange question here. I'm using FSharp.Data.SqlClient to get records from our Database. The records that it infers have several fields which are option types. I need to filter out the records where the ANY of the option types are None and…
Matthew Crews
  • 4,105
  • 7
  • 33
  • 57
4
votes
2 answers

f# sqlite sqlprovider minBy maxBy using float

I have a sqlite table with a mix of integer and float columns. I'm trying to get the max and min values of each column. For integer columns the following code works but I get a cast error when using the same code on float columns: let numCats =…
3
votes
0 answers

F# Type provider FSharp,Data.SqlClient targeting .NetStandard 2.0 fails when using dotNet Build from commandLine but succeeds in Visual Studion 2019

I am using the F# Type Provider FSharp.Data.SqlClient in a DLL targeting .Net-Standard-2.0, while this successfully builds in Visual Studio 2019 it fails when I try to build it using the command prompt compiler dotNet compiler with the following…
Z.M.
  • 39
  • 1
3
votes
1 answer

FSharp.Data.SqlClient with multiple result sets

With FSharp.Data.SqlClient, how do you use SqlCommandProvider or SqlProgrammabilityProvider with multiple result sets? For instance if you wanted to get Customer+Orders where your stored procedure returns the customer info in the first result set…
schmoopy
  • 6,419
  • 11
  • 54
  • 89
3
votes
2 answers

Using query expression vs Seq modules?

Are there any advantages in using the query expression over Sequence modules when manipulating data retrieved via FSharp.Data.SqlClient? For example: query{ for row in SelectAllCategories.Execute() do where row.Id = 1 select { Id…
user1206480
  • 1,798
  • 3
  • 28
  • 45
3
votes
1 answer

Why is FSharp.Data.SqlClient record exposed as object?

I'm working on a demo where I can show how easy it is to use the SqlClient type provider in a F# library and then consume it from C#, I think this might be one way to get things into projects. Since many people using C# want to use interfaces etc. I…
Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137
3
votes
1 answer

Named Parameters with fsharp data SqlClient

I am having trouble getting this code to compile when loading the T-Sql from an external file. The code works when the T-Sql is inserted directly in F# as: type GetRecentMedia = SqlCommandProvider<"DECLARE @MedId NVARCHAR(128); …
user1206480
  • 1,798
  • 3
  • 28
  • 45
3
votes
0 answers

FSharp.Data.SqlClient Type Provider on machine without SQL installed (CI server)

I've started using FSharp.Data.SqlClient type provider lately and I'm having trouble to make it work with AppVeyor build system. Problem is, that on the machine build is running at, there is no database running, so specifying local connection string…
2
votes
1 answer

F# - FSharp.Data.SqlClient – How to specify timeout for Update

I use FSharp.Data.SqlClient type providers to access SQL server database. So, I set up the types in F# something as follows: type ClmDB = SqlProgrammabilityProvider type ResultDataTable =…
2
votes
1 answer

Project with generated types fails on Assembly.GetExportedTypes()

I'm working on upgrading FSharp.Data.SqlClient to the latest version of the Type Provider SDK and I'm seeing an error when using generated types. The test project, which references numerous generated types, compiles just fine, but when I attempt to…
Sam Hanes
  • 273
  • 2
  • 7
2
votes
2 answers

Why is the program still running while Error FS0039 The type 'JsonProvider' is not defined?

I'm trying to learn Fsharp.data with the example of JsonProvider, but I can not understand why I'm still running the program while compiling the error.
2
votes
1 answer

Using Fsharp.Sql.DataClient via a referenced project in asp.net core

I am building an Asp.net Core (.NET Framework 4.6.2) project. I added a referenced F# project that uses FSharp.Sql.DataClient. When I call the F# code from the main project to retrieve data from the database I get this error: Keyword not…
user1206480
  • 1,798
  • 3
  • 28
  • 45
2
votes
2 answers

Populate list with Types

Im trying to populate list with my own type. let getUsers = use connection = openConnection() let getString = "select * from Accounts" use sqlCommand = new SqlCommand(getString, connection) try let usersList = [||] …
Sk1X1
  • 1,305
  • 5
  • 22
  • 50
1
2