Sql Module
Functions and values
| Function or value |
Description
|
Full Usage:
connect con f
Parameters:
IDbConnection
f : IDbConnection -> 'a
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".
|
Full Usage:
connectAndClose con f
Parameters:
IDbConnection
f : IDbConnection -> 'a
Returns: 'a
Type parameters: 'a |
|
Full Usage:
connectAndCloseAsync con f
Parameters:
DbConnection
f : DbConnection -> Task<'a>
Returns: Task<'a>
Type parameters: 'a |
|
Full Usage:
connectAsync con f
Parameters:
DbConnection
f : DbConnection -> Task<'a>
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".
|
|
|
Full Usage:
dataReaderToArrayAsync reader
Parameters:
DbDataReader
Returns: Task<(string * obj)[] array>
|
|
Full Usage:
dbUnbox v
Parameters:
obj
Returns: 'a
Modifiers: inline Type parameters: 'a |
|
Full Usage:
dbUnboxWithDefault def v
Parameters:
'a
v : obj
Returns: 'a
Modifiers: inline Type parameters: 'a |
|
|
|
Full Usage:
evaluateOneByOne asyncFunc entityList
Parameters:
'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.
|
Full Usage:
executeSql createCommand sql con
Parameters:
'a -> IDbConnection -> IDbCommand
sql : 'a
con : IDbConnection
Returns: IDataReader
Type parameters: 'a |
|
Full Usage:
executeSqlAsDataTable createCommand sql con
Parameters:
'a -> IDbConnection -> IDbCommand
sql : 'a
con : IDbConnection
Returns: DataTable
Type parameters: 'a |
|
Full Usage:
executeSqlAsDataTableAsync createCommand sql con
Parameters:
'a -> IDbConnection -> DbCommand
sql : 'a
con : IDbConnection
Returns: Task<DataTable>
Type parameters: 'a |
|
Full Usage:
executeSqlAsync createCommand sql con
Parameters:
'a -> IDbConnection -> DbCommand
sql : 'a
con : IDbConnection
Returns: Task<DbDataReader>
Type parameters: 'a |
|
Full Usage:
guidOfText value
Parameters:
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.
|
Full Usage:
readDescriptions reader
Parameters:
IDataReader
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.
|
Full Usage:
tableSchemaAndName fullName
Parameters:
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.
|