Table of Contents

Class SqlModule

Namespace
Npgsql.FSharp
Assembly
Npgsql.FSharp.dll
public static class SqlModule
Inheritance
SqlModule
Inherited Members

Methods

config(string, ConnectionStringBuilder)

public static SqlModule.ConnectionStringBuilder config(string extraConfig, SqlModule.ConnectionStringBuilder config)

Parameters

extraConfig string
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

connect(string)

public static SqlModule.SqlProps connect(string constr)

Parameters

constr string

Returns

SqlModule.SqlProps

connectFromConfig(ConnectionStringBuilder)

public static SqlModule.SqlProps connectFromConfig(SqlModule.ConnectionStringBuilder connectionConfig)

Parameters

connectionConfig SqlModule.ConnectionStringBuilder

Returns

SqlModule.SqlProps

convertInfinityDateTime(bool, ConnectionStringBuilder)

public static SqlModule.ConnectionStringBuilder convertInfinityDateTime(bool value, SqlModule.ConnectionStringBuilder config)

Parameters

value bool
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

database(string, ConnectionStringBuilder)

Specifies the database name

public static SqlModule.ConnectionStringBuilder database(string x, SqlModule.ConnectionStringBuilder con)

Parameters

x string
con SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

executeMany(SqlProps)

Executes multiple queries and returns each result set as a distinct table

public static FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>> executeMany(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>

executeManyAsync(SqlProps)

public static FSharpAsync<FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>> executeManyAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>>

executeManyTask(SqlProps)

public static Task<FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>> executeManyTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

Task<FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>>

executeManyTaskCt(CancellationToken, SqlProps)

Executes multiple queries and returns each result set as a distinct table

public static Task<FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>> executeManyTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<FSharpList<FSharpList<FSharpList<Tuple<string, SqlValue>>>>>

executeNonQuery(SqlProps)

Executes the query and returns the number of rows affected

public static int executeNonQuery(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

int

executeNonQueryAsync(SqlProps)

Executes the query as asynchronously and returns the number of rows affected

public static FSharpAsync<int> executeNonQueryAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<int>

executeNonQuerySafe(SqlProps)

Executes the query safely (does not throw) and returns the number of rows affected

public static FSharpResult<int, Exception> executeNonQuerySafe(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpResult<int, Exception>

executeNonQuerySafeAsync(SqlProps)

Executes the query safely asynchronously (does not throw) and returns the number of rows affected

public static FSharpAsync<FSharpResult<int, Exception>> executeNonQuerySafeAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<FSharpResult<int, Exception>>

executeNonQuerySafeTask(SqlProps)

Executes the query safely as task (does not throw) and returns the number of rows affected

public static Task<FSharpResult<int, Exception>> executeNonQuerySafeTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

Task<FSharpResult<int, Exception>>

executeNonQuerySafeTaskCt(CancellationToken, SqlProps)

Executes the query safely as task (does not throw) and returns the number of rows affected

public static Task<FSharpResult<int, Exception>> executeNonQuerySafeTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<FSharpResult<int, Exception>>

executeNonQueryTask(SqlProps)

Executes the query as a task and returns the number of rows affected

public static Task<int> executeNonQueryTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

Task<int>

executeNonQueryTaskCt(CancellationToken, SqlProps)

Executes the query as a task and returns the number of rows affected

public static Task<int> executeNonQueryTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<int>

executeReaderAsync<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>>, SqlProps)

public static FSharpAsync<FSharpList<t>> executeReaderAsync<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>> read, SqlModule.SqlProps props)

Parameters

read FSharpFunc<NpgsqlDataReader, FSharpOption<t>>
props SqlModule.SqlProps

Returns

FSharpAsync<FSharpList<t>>

Type Parameters

t

executeReaderSafeAsync<a>(SqlProps, FSharpFunc<NpgsqlDataReader, FSharpOption<a>>)

public static FSharpAsync<FSharpResult<FSharpList<a>, Exception>> executeReaderSafeAsync<a>(SqlModule.SqlProps props, FSharpFunc<NpgsqlDataReader, FSharpOption<a>> read)

Parameters

props SqlModule.SqlProps
read FSharpFunc<NpgsqlDataReader, FSharpOption<a>>

Returns

FSharpAsync<FSharpResult<FSharpList<a>, Exception>>

Type Parameters

a

executeReaderSafeTaskCt<t>(CancellationToken, FSharpFunc<NpgsqlDataReader, FSharpOption<t>>, SqlProps)

public static Task<FSharpResult<FSharpList<t>, Exception>> executeReaderSafeTaskCt<t>(CancellationToken cancellationToken, FSharpFunc<NpgsqlDataReader, FSharpOption<t>> read, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
read FSharpFunc<NpgsqlDataReader, FSharpOption<t>>
props SqlModule.SqlProps

Returns

Task<FSharpResult<FSharpList<t>, Exception>>

Type Parameters

t

executeReaderSafeTask<a>(SqlProps, FSharpFunc<NpgsqlDataReader, FSharpOption<a>>)

public static Task<FSharpResult<FSharpList<a>, Exception>> executeReaderSafeTask<a>(SqlModule.SqlProps read, FSharpFunc<NpgsqlDataReader, FSharpOption<a>> props)

Parameters

read SqlModule.SqlProps
props FSharpFunc<NpgsqlDataReader, FSharpOption<a>>

Returns

Task<FSharpResult<FSharpList<a>, Exception>>

Type Parameters

a

executeReaderSafe<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>>, SqlProps)

public static FSharpResult<FSharpList<t>, Exception> executeReaderSafe<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>> read, SqlModule.SqlProps props)

Parameters

read FSharpFunc<NpgsqlDataReader, FSharpOption<t>>
props SqlModule.SqlProps

Returns

FSharpResult<FSharpList<t>, Exception>

Type Parameters

t

executeReaderTaskCt<t>(CancellationToken, SqlProps, FSharpFunc<NpgsqlDataReader, FSharpOption<t>>)

public static Task<FSharpList<t>> executeReaderTaskCt<t>(CancellationToken cancellationToken, SqlModule.SqlProps props, FSharpFunc<NpgsqlDataReader, FSharpOption<t>> read)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps
read FSharpFunc<NpgsqlDataReader, FSharpOption<t>>

Returns

Task<FSharpList<t>>

Type Parameters

t

executeReaderTask<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>>, SqlProps)

public static Task<FSharpList<t>> executeReaderTask<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>> read, SqlModule.SqlProps props)

Parameters

read FSharpFunc<NpgsqlDataReader, FSharpOption<t>>
props SqlModule.SqlProps

Returns

Task<FSharpList<t>>

Type Parameters

t

executeReader<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>>, SqlProps)

public static FSharpList<t> executeReader<t>(FSharpFunc<NpgsqlDataReader, FSharpOption<t>> read, SqlModule.SqlProps props)

Parameters

read FSharpFunc<NpgsqlDataReader, FSharpOption<t>>
props SqlModule.SqlProps

Returns

FSharpList<t>

Type Parameters

t

executeScalar(SqlProps)

public static SqlValue executeScalar(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

SqlValue

executeScalarAsync(SqlProps)

public static FSharpAsync<SqlValue> executeScalarAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<SqlValue>

executeScalarSafe(SqlProps)

Executes the query and returns a scalar value safely (does not throw)

public static FSharpResult<SqlValue, Exception> executeScalarSafe(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpResult<SqlValue, Exception>

executeScalarSafeAsync(SqlProps)

public static FSharpAsync<FSharpResult<SqlValue, Exception>> executeScalarSafeAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<FSharpResult<SqlValue, Exception>>

executeScalarSafeTask(SqlProps)

public static Task<FSharpResult<SqlValue, Exception>> executeScalarSafeTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

Task<FSharpResult<SqlValue, Exception>>

executeScalarSafeTaskCt(CancellationToken, SqlProps)

public static Task<FSharpResult<SqlValue, Exception>> executeScalarSafeTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<FSharpResult<SqlValue, Exception>>

executeScalarTask(SqlProps)

public static Task<SqlValue> executeScalarTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

Task<SqlValue>

executeScalarTaskCt(CancellationToken, SqlProps)

public static Task<SqlValue> executeScalarTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<SqlValue>

executeTable(SqlProps)

public static FSharpList<FSharpList<Tuple<string, SqlValue>>> executeTable(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpList<FSharpList<Tuple<string, SqlValue>>>

executeTableAsync(SqlProps)

public static FSharpAsync<FSharpList<FSharpList<Tuple<string, SqlValue>>>> executeTableAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<FSharpList<FSharpList<Tuple<string, SqlValue>>>>

executeTableSafe(SqlProps)

public static FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception> executeTableSafe(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>

executeTableSafeAsync(SqlProps)

public static FSharpAsync<FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>> executeTableSafeAsync(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpAsync<FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>>

executeTableSafeTask(SqlProps)

public static Task<FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>> executeTableSafeTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

Task<FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>>

executeTableSafeTaskCt(CancellationToken, SqlProps)

public static Task<FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>> executeTableSafeTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<FSharpResult<FSharpList<FSharpList<Tuple<string, SqlValue>>>, Exception>>

executeTableTask(SqlProps)

public static FSharpFunc<SqlModule.SqlProps, Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>>> executeTableTask(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

FSharpFunc<SqlProps, Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>>>

executeTableTaskCt(CancellationToken, SqlProps)

public static Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>> executeTableTaskCt(CancellationToken cancellationToken, SqlModule.SqlProps props)

Parameters

cancellationToken CancellationToken
props SqlModule.SqlProps

Returns

Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>>

executeTransaction(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>, SqlProps)

public static FSharpList<int> executeTransaction(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>> queries, SqlModule.SqlProps props)

Parameters

queries FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>
props SqlModule.SqlProps

Returns

FSharpList<int>

executeTransactionAsync(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>, SqlProps)

public static FSharpAsync<FSharpList<int>> executeTransactionAsync(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>> queries, SqlModule.SqlProps props)

Parameters

queries FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>
props SqlModule.SqlProps

Returns

FSharpAsync<FSharpList<int>>

executeTransactionSafe(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>, SqlProps)

public static FSharpResult<FSharpList<int>, Exception> executeTransactionSafe(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>> queries, SqlModule.SqlProps props)

Parameters

queries FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>
props SqlModule.SqlProps

Returns

FSharpResult<FSharpList<int>, Exception>

executeTransactionSafeAsync(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>, SqlProps)

public static FSharpAsync<FSharpResult<FSharpList<int>, Exception>> executeTransactionSafeAsync(FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>> queries, SqlModule.SqlProps props)

Parameters

queries FSharpList<Tuple<string, FSharpList<FSharpList<Tuple<string, SqlValue>>>>>
props SqlModule.SqlProps

Returns

FSharpAsync<FSharpResult<FSharpList<int>, Exception>>

fromUri(Uri)

Turns the given postgres Uri into a proper connection string

public static string fromUri(Uri uri)

Parameters

uri Uri

Returns

string

fromUriToConfig(Uri)

Creates initial database connection configration from a the Uri components. It try to find Host, Username, Password, Database and Port from the input Uri.

public static SqlModule.ConnectionStringBuilder fromUriToConfig(Uri uri)

Parameters

uri Uri

Returns

SqlModule.ConnectionStringBuilder

func(string, SqlProps)

public static SqlModule.SqlProps func(string sql, SqlModule.SqlProps props)

Parameters

sql string
props SqlModule.SqlProps

Returns

SqlModule.SqlProps

host(string)

public static SqlModule.ConnectionStringBuilder host(string x)

Parameters

x string

Returns

SqlModule.ConnectionStringBuilder

mapEachRow<a>(FSharpFunc<FSharpList<Tuple<string, SqlValue>>, FSharpOption<a>>, FSharpList<FSharpList<Tuple<string, SqlValue>>>)

public static FSharpList<a> mapEachRow<a>(FSharpFunc<FSharpList<Tuple<string, SqlValue>>, FSharpOption<a>> f, FSharpList<FSharpList<Tuple<string, SqlValue>>> table)

Parameters

f FSharpFunc<FSharpList<Tuple<string, SqlValue>>, FSharpOption<a>>
table FSharpList<FSharpList<Tuple<string, SqlValue>>>

Returns

FSharpList<a>

Type Parameters

a

multiline(IEnumerable<string>)

public static string multiline(IEnumerable<string> xs)

Parameters

xs IEnumerable<string>

Returns

string

newConnection(SqlProps)

public static NpgsqlConnection newConnection(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

NpgsqlConnection

parameters(FSharpList<Tuple<string, SqlValue>>, SqlProps)

public static SqlModule.SqlProps parameters(FSharpList<Tuple<string, SqlValue>> ls, SqlModule.SqlProps props)

Parameters

ls FSharpList<Tuple<string, SqlValue>>
props SqlModule.SqlProps

Returns

SqlModule.SqlProps

parseEachRow<a>()

public static FSharpFunc<FSharpList<FSharpList<Tuple<string, SqlValue>>>, FSharpList<a>> parseEachRow<a>()

Returns

FSharpFunc<FSharpList<FSharpList<Tuple<string, SqlValue>>>, FSharpList<a>>

Type Parameters

a

parseRow<a>(FSharpList<Tuple<string, SqlValue>>)

public static FSharpOption<a> parseRow<a>(FSharpList<Tuple<string, SqlValue>> row)

Parameters

row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<a>

Type Parameters

a

password(string, ConnectionStringBuilder)

Specifies the password of the user that is logging in into the database server

public static SqlModule.ConnectionStringBuilder password(string password, SqlModule.ConnectionStringBuilder config)

Parameters

password string
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

port(int, ConnectionStringBuilder)

Specifies the port of the database server. If you don't specify the port, the default port of 5432 is used.

public static SqlModule.ConnectionStringBuilder port(int port, SqlModule.ConnectionStringBuilder config)

Parameters

port int
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

prepare(SqlProps)

public static SqlModule.SqlProps prepare(SqlModule.SqlProps props)

Parameters

props SqlModule.SqlProps

Returns

SqlModule.SqlProps

query(string, SqlProps)

public static SqlModule.SqlProps query(string sql, SqlModule.SqlProps props)

Parameters

sql string
props SqlModule.SqlProps

Returns

SqlModule.SqlProps

queryMany(FSharpList<string>, SqlProps)

public static SqlModule.SqlProps queryMany(FSharpList<string> queries, SqlModule.SqlProps props)

Parameters

queries FSharpList<string>
props SqlModule.SqlProps

Returns

SqlModule.SqlProps

readBool(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a bool from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of bool and when it is not null. Returns None otherwise.

public static FSharpOption<bool> readBool(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<bool>

readBytea(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a byte array from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of byte array or bytea in Postgres and when it is not null. Returns None otherwise.

public static FSharpOption<byte[]> readBytea(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<byte[]>

readDate(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a DateTime from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of DateTime and when it is not null. Returns None otherwise.

public static FSharpOption<DateTime> readDate(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<DateTime>

readDateTimeOffset(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a DateTimeOffset from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of DateTimeOffset or (timestamp|time) with timezone in Postgres and when it is not null. Returns None otherwise. Alias for Sql.readTimeWithTimeZone

public static FSharpOption<DateTimeOffset> readDateTimeOffset(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<DateTimeOffset>

readDecimal(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a decimal from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of decimal and when it is not null. Returns None otherwise.

public static FSharpOption<decimal> readDecimal(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<decimal>

readHStore(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a Map<string, string> from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of HStore which is a key-value dictionary in Postgres. Returns None otherwise.

public static FSharpOption<FSharpMap<string, string>> readHStore(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<FSharpMap<string, string>>

readInt(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as an int from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of integer and when it is not null. Returns None otherwise.

public static FSharpOption<int> readInt(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<int>

readLong(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as an int64 from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of int64 and when it is not null. Returns None otherwise.

public static FSharpOption<long> readLong(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<long>

readNumber(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a double from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of double and when it is not null. Returns None otherwise.

public static FSharpOption<double> readNumber(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<double>

readRow(NpgsqlDataReader)

Reads a single row from the data reader synchronously

public static FSharpList<Tuple<string, SqlValue>> readRow(NpgsqlDataReader reader)

Parameters

reader NpgsqlDataReader

Returns

FSharpList<Tuple<string, SqlValue>>

readRowAsync(NpgsqlDataReader)

Reads a single row from the data reader asynchronously

public static FSharpAsync<Tuple<string, SqlValue>[]> readRowAsync(NpgsqlDataReader reader)

Parameters

reader NpgsqlDataReader

Returns

FSharpAsync<Tuple<string, SqlValue>[]>

readRowTask(NpgsqlDataReader)

Reads a single row from the data reader asynchronously

public static Task<Tuple<string, SqlValue>[]> readRowTask(NpgsqlDataReader reader)

Parameters

reader NpgsqlDataReader

Returns

Task<Tuple<string, SqlValue>[]>

readRowTaskCt(CancellationToken, NpgsqlDataReader)

Reads a single row from the data reader asynchronously

public static Task<Tuple<string, SqlValue>[]> readRowTaskCt(CancellationToken cancellationToken, NpgsqlDataReader reader)

Parameters

cancellationToken CancellationToken
reader NpgsqlDataReader

Returns

Task<Tuple<string, SqlValue>[]>

readString(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as an string from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of string and when it is not null. Returns None otherwise.

public static FSharpOption<string> readString(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<string>

readTable(NpgsqlDataReader)

public static FSharpList<FSharpList<Tuple<string, SqlValue>>> readTable(NpgsqlDataReader reader)

Parameters

reader NpgsqlDataReader

Returns

FSharpList<FSharpList<Tuple<string, SqlValue>>>

readTableAsync(NpgsqlDataReader)

public static FSharpAsync<FSharpList<FSharpList<Tuple<string, SqlValue>>>> readTableAsync(NpgsqlDataReader reader)

Parameters

reader NpgsqlDataReader

Returns

FSharpAsync<FSharpList<FSharpList<Tuple<string, SqlValue>>>>

readTableTask(NpgsqlDataReader)

public static Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>> readTableTask(NpgsqlDataReader reader)

Parameters

reader NpgsqlDataReader

Returns

Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>>

readTableTaskCt(CancellationToken, NpgsqlDataReader)

public static Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>> readTableTaskCt(CancellationToken cancellationToken, NpgsqlDataReader reader)

Parameters

cancellationToken CancellationToken
reader NpgsqlDataReader

Returns

Task<FSharpList<FSharpList<Tuple<string, SqlValue>>>>

readTime(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a TimeSpan from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of TimeSpan and when it is not null. Returns None otherwise.

public static FSharpOption<TimeSpan> readTime(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<TimeSpan>

readTimeWithTimeZone(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a DateTimeOffset from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of DateTimeOffset or (timestamp|time) with timezone in Postgres and when it is not null. Returns None otherwise.

public static FSharpOption<DateTimeOffset> readTimeWithTimeZone(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<DateTimeOffset>

readUuid(string, FSharpList<Tuple<string, SqlValue>>)

Tries to read the column value as a Guid from a row based on the provided name of the column. Returns Some value when the column exists, when it has the type of Guid (type Uuid in Postgres) and when it is not null. Returns None otherwise.

public static FSharpOption<Guid> readUuid(string columnName, FSharpList<Tuple<string, SqlValue>> row)

Parameters

columnName string
row FSharpList<Tuple<string, SqlValue>>

Returns

FSharpOption<Guid>

readValue<a>(FSharpOption<string>, a)

public static SqlValue readValue<a>(FSharpOption<string> columnName, a value)

Parameters

columnName FSharpOption<string>
value a

Returns

SqlValue

Type Parameters

a

sslMode(SslMode, ConnectionStringBuilder)

Specifies how to manage SSL Mode.

public static SqlModule.ConnectionStringBuilder sslMode(SslMode mode, SqlModule.ConnectionStringBuilder config)

Parameters

mode SslMode
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

str(ConnectionStringBuilder)

public static string str(SqlModule.ConnectionStringBuilder config)

Parameters

config SqlModule.ConnectionStringBuilder

Returns

string

toBool(SqlValue)

public static bool toBool(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

bool

toDateTime(SqlValue)

public static DateTime toDateTime(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

DateTime

toFloat(SqlValue)

public static double toFloat(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

double

toInt(SqlValue)

public static int toInt(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

int

toLong(SqlValue)

public static long toLong(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

long

toString(SqlValue)

public static string toString(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

string

toTime(SqlValue)

public static TimeSpan toTime(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

TimeSpan

trustServerCertificate(bool, ConnectionStringBuilder)

public static SqlModule.ConnectionStringBuilder trustServerCertificate(bool value, SqlModule.ConnectionStringBuilder config)

Parameters

value bool
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

username(string, ConnectionStringBuilder)

public static SqlModule.ConnectionStringBuilder username(string username, SqlModule.ConnectionStringBuilder config)

Parameters

username string
config SqlModule.ConnectionStringBuilder

Returns

SqlModule.ConnectionStringBuilder

withCert(X509Certificate, SqlProps)

public static SqlModule.SqlProps withCert(X509Certificate cert, SqlModule.SqlProps props)

Parameters

cert X509Certificate
props SqlModule.SqlProps

Returns

SqlModule.SqlProps

|NullBool|_|(SqlValue)

public static FSharpOption<bool> |NullBool|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<bool>

|NullBytea|_|(SqlValue)

public static FSharpOption<byte[]> |NullBytea|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<byte[]>

|NullDate|_|(SqlValue)

public static FSharpOption<DateTime> |NullDate|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<DateTime>

|NullDecimal|_|(SqlValue)

public static FSharpOption<decimal> |NullDecimal|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<decimal>

|NullHStore|_|(SqlValue)

public static FSharpOption<FSharpMap<string, string>> |NullHStore|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<FSharpMap<string, string>>

|NullInt|_|(SqlValue)

public static FSharpOption<int> |NullInt|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<int>

|NullLong|_|(SqlValue)

public static FSharpOption<long> |NullLong|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<long>

|NullNumber|_|(SqlValue)

public static FSharpOption<double> |NullNumber|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<double>

|NullShort|_|(SqlValue)

public static FSharpOption<short> |NullShort|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<short>

|NullTimeWithTimeZone|_|(SqlValue)

public static FSharpOption<DateTimeOffset> |NullTimeWithTimeZone|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<DateTimeOffset>

|NullUuid|_|(SqlValue)

public static FSharpOption<Guid> |NullUuid|_|(SqlValue _arg1)

Parameters

_arg1 SqlValue

Returns

FSharpOption<Guid>