SQLProvider


PostgreSQL Provider

Parameters

DatabaseVendor

From the FSharp.Data.Sql.Common.DatabaseProviderTypes enumeration. For PostgreSQL, use Common.DatabaseProviderTypes.POSTGRESQL.

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

ConnectionString

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

1: 
let [<Literal>] connString = "Host=localhost;Database=test;Username=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 (TODO: confirm file name).

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

Resolution Path

Path to search for assemblies containing database vendor specific connections and custom types. Type the path where Npgsql.Data.dll is stored.

1: 
let [<Literal>] resPath = @"C:\Projects\Libs\Npgsql"

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: 
10: 
let [<Literal>] useOptTypes  = true

type sql =
    SqlDataProvider<
        dbVendor,
        connString,
        "",         //ConnectionNameString can be left empty 
        resPath,
        indivAmount,
        useOptTypes>
Fork me on GitHub