SQLProvider


MSSQL Provider

Parameters

DatabaseVendor

From the FSharp.Data.Sql.Common.DatabaseProviderTypes enumeration. For MSSQL, use Common.DatabaseProviderTypes.MSSQLSERVER.

1: 
let [<Literal>] dbVendor = Common.DatabaseProviderTypes.MSSQLSERVER

ConnectionString

Basic connection string used to connect to MSSQL instance; typical connection strings for the driver apply here. See MSSQL Connecting Strings Documentation for a complete list of connection string options.

1: 
let [<Literal>] connString = "Server=localhost;Database=test;User Id=test;Password=test"

ConnectionStringName

Instead of storing the connection string in the source code / fsx script, you can store values in the App.config file. This is the name of the connectionString key/value pair stored in App.config.

1: 
2: 
// found in App.config
let [<Literal>] connexStringName = "DefaultConnectionString"

IndividualsAmount

Sets the count to load for each individual. See individuals for further info.

1: 
let [<Literal>] indivAmount = 1000

UseOptionTypes

If true, F# option types will be used in place of nullable database columns. If false, you will always receive the default value of the column's type, even if it is null in the database.

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
let [<Literal>] useOptTypes  = true

let sql =
    SqlDataProvider<
        dbVendor,
        connString,
        resPath,
        indivAmount,
        useOptTypes>

Because MSSQL databases can be huge, there is an optional constructor parameter TableNames that can be used as a filter.

Multiple items
type LiteralAttribute =
  inherit Attribute
  new : unit -> LiteralAttribute

Full name: Microsoft.FSharp.Core.LiteralAttribute

--------------------
new : unit -> LiteralAttribute
val connectionString : string

Full name: Mssql.connectionString
val resolutionPath : string

Full name: Mssql.resolutionPath
Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
Multiple items
namespace FSharp.Data

--------------------
namespace Microsoft.FSharp.Data
namespace FSharp.Data.Sql
val dbVendor : Common.DatabaseProviderTypes

Full name: Mssql.dbVendor
namespace FSharp.Data.Sql.Common
type DatabaseProviderTypes =
  | MSSQLSERVER = 0
  | SQLITE = 1
  | POSTGRESQL = 2
  | MYSQL = 3
  | ORACLE = 4
  | MSACCESS = 5
  | ODBC = 6

Full name: FSharp.Data.Sql.Common.DatabaseProviderTypes
Common.DatabaseProviderTypes.MSSQLSERVER: Common.DatabaseProviderTypes = 0
val connString : string

Full name: Mssql.connString
val connexStringName : string

Full name: Mssql.connexStringName
val indivAmount : int

Full name: Mssql.indivAmount
val useOptTypes : bool

Full name: Mssql.useOptTypes
val sql : obj

Full name: Mssql.sql
type SqlDataProvider

Full name: FSharp.Data.Sql.SqlDataProvider


<summary>Typed representation of a database</summary>
                    <param name='ConnectionString'>The connection string for the SQL database</param>
                    <param name='ConnectionStringName'>The connection string name to select from a configuration file</param>
                    <param name='DatabaseVendor'> The target database vendor</param>
                    <param name='IndividualsAmount'>The amount of sample entities to project into the type system for each SQL entity type. Default 1000.</param>
                    <param name='UseOptionTypes'>If true, F# option types will be used in place of nullable database columns. If false, you will always receive the default value of the column's type even if it is null in the database.</param>
                    <param name='ResolutionPath'>The location to look for dynamically loaded assemblies containing database vendor specific connections and custom types.</param>
                    <param name='Owner'>The owner of the schema for this provider to resolve (Oracle Only)</param>
                    <param name='CaseSensitivityChange'>Should we do ToUpper or ToLower when generating table names?</param>
                    <param name='TableNames'>Comma separated table names list to limit a number of tables in big instances. The names can have '%' sign to handle it as in the 'LIKE' query (Oracle and MSSQL Only)</param>
                    <param name='OdbcQuote'>Odbc quote characters: Quote characters for the table and column names: `alias`, [alias]</param>
                    <param name='SQLiteLibrary'>Use System.Data.SQLite or Mono.Data.SQLite or select automatically (SQLite only)</param>
                    
Fork me on GitHub