SQLProvider

Sql Module

Functions and values

Function or value Description

connect con f

Full Usage: connect con f

Parameters:
Returns: 'a
Type parameters: 'a

Note: SQLProvider reuses the connection through multiple instances, so you can't dispose it here. Instead it's created with ISQLProvider's CreateConnection method, and that is having always "use" to ensure it is disposed properly on "finally".

con : IDbConnection
f : IDbConnection -> 'a
Returns: 'a

connectAndClose con f

Full Usage: connectAndClose con f

Parameters:
Returns: 'a
Type parameters: 'a
con : IDbConnection
f : IDbConnection -> 'a
Returns: 'a

connectAndCloseAsync con f

Full Usage: connectAndCloseAsync con f

Parameters:
Returns: Task<'a>
Type parameters: 'a
con : DbConnection
f : DbConnection -> Task<'a>
Returns: Task<'a>

connectAsync con f

Full Usage: connectAsync con f

Parameters:
Returns: Task<Task<'a>>
Type parameters: 'a

Note: SQLProvider reuses the connection through multiple instances, so you can't dispose it here. Instead it's created with ISQLProvider's CreateConnection method, and that is having always "use" to ensure it is disposed properly on "finally".

con : DbConnection
f : DbConnection -> Task<'a>
Returns: Task<Task<'a>>

dataReaderToArray reader

Full Usage: dataReaderToArray reader

Parameters:
Returns: (string * obj)[][]
reader : IDataReader
Returns: (string * obj)[][]

dataReaderToArrayAsync reader

Full Usage: dataReaderToArrayAsync reader

Parameters:
Returns: Task<(string * obj)[] array>
reader : DbDataReader
Returns: Task<(string * obj)[] array>

dbUnbox v

Full Usage: dbUnbox v

Parameters:
    v : obj

Returns: 'a
Modifiers: inline
Type parameters: 'a
v : obj
Returns: 'a

dbUnboxWithDefault def v

Full Usage: dbUnboxWithDefault def v

Parameters:
    def : 'a
    v : obj

Returns: 'a
Modifiers: inline
Type parameters: 'a
def : 'a
v : obj
Returns: 'a

ensureOpen con

Full Usage: ensureOpen con

Parameters:

evaluateOneByOne asyncFunc entityList

Full Usage: evaluateOneByOne asyncFunc entityList

Parameters:
    asyncFunc : 'a -> 'b
    entityList : 'a seq

Returns: Task<'c list>
Type parameters: 'a, 'b, 'c (requires :> System.Threading.Tasks.Task<'c>)

Helper function to run async computation non-parallel style for list of objects. This is needed if async database opreation is executed for a list of entities. DB-connections are not usually supporting parallel SQL-query execution, so even when async thread is available, it can't be used to execute another SQL at the same time.

asyncFunc : 'a -> 'b
entityList : 'a seq
Returns: Task<'c list>

executeSql createCommand sql con

Full Usage: executeSql createCommand sql con

Parameters:
Returns: IDataReader
Type parameters: 'a
createCommand : 'a -> IDbConnection -> IDbCommand
sql : 'a
con : IDbConnection
Returns: IDataReader

executeSqlAsDataTable createCommand sql con

Full Usage: executeSqlAsDataTable createCommand sql con

Parameters:
Returns: DataTable
Type parameters: 'a
createCommand : 'a -> IDbConnection -> IDbCommand
sql : 'a
con : IDbConnection
Returns: DataTable

executeSqlAsDataTableAsync createCommand sql con

Full Usage: executeSqlAsDataTableAsync createCommand sql con

Parameters:
Returns: Task<DataTable>
Type parameters: 'a
createCommand : 'a -> IDbConnection -> DbCommand
sql : 'a
con : IDbConnection
Returns: Task<DataTable>

executeSqlAsync createCommand sql con

Full Usage: executeSqlAsync createCommand sql con

Parameters:
Returns: Task<DbDataReader>
Type parameters: 'a
createCommand : 'a -> IDbConnection -> DbCommand
sql : 'a
con : IDbConnection
Returns: Task<DbDataReader>

guidOfText value

Full Usage: guidOfText value

Parameters:
    value : obj

Returns: obj

The Guid of a text that is one; any other value as it is. The key of an individual with a Guid key is text, because a Guid can't be a constant in a provided quotation, and not every database takes text for a Guid parameter.

value : obj
Returns: obj

readDescriptions reader

Full Usage: readDescriptions reader

Parameters:
Returns: IDictionary<string, string>

Reads rows of a name and its description to a dictionary. Rows without a description are left out, and of rows with the same name the first one counts.

reader : IDataReader
Returns: IDictionary<string, string>

tableSchemaAndName fullName

Full Usage: tableSchemaAndName fullName

Parameters:
    fullName : string

Returns: string * string

The schema ("" without one) and the name of a table from its FullName, schema.name. A name with a space in it is in quotes in FullName (quoteWhiteSpace): those quotes are left out, so the name is as the database has it.

fullName : string
Returns: string * string

Type something to start searching.