CommonTasks Module
Functions and values
| Function or value |
Description
|
Full Usage:
``ensurecolumnshavebeenloaded`` provider con entities
Parameters:
ISqlProvider
con : IDbConnection
entities : ConcurrentDictionary<SqlEntity, DateTime>
|
|
Full Usage:
checkKey pkLookup id e
Parameters:
ConcurrentDictionary<string, string list>
id : 'a
e : SqlEntity
Type parameters: 'a |
|
Full Usage:
conflictColumns table columns names
Parameters:
Table
columns : ColumnLookup
names : string list
Returns: string list
|
The columns OnConflict.DoNothingOn and UpdateOn name, as the table spells them. Each must be one of the table's columns, matched ignoring case, so no other text reaches the SQL. A column named twice is refused.
|
Full Usage:
conflictUpdates table columns quote excluded parameter updates
Parameters:
Table
columns : ColumnLookup
quote : string -> string
excluded : string -> string
parameter : Column -> obj -> string
updates : ConflictUpdate list
Returns: string
|
The SET list of OnConflict.UpdateOn: each named column to the inserted row's value (`excluded column`) or to a constant, which `parameter` adds to the command and names. The names are checked as conflictColumns does.
|
Full Usage:
groupKeyColumn keys index column notation plain
Parameters:
(alias * SqlColumnType) list
index : int
column : SqlColumnType
notation : string
plain : string
Returns: string
|
The select-list entry of a group-key column. In a key of several columns, a computed one (a CASE for x.IsSome or
x.IsNone) is aliased sqlp_key
|
Full Usage:
groupSelectColumns grouping keys aggregates
Parameters:
GroupingColumns list
keys : string list
aggregates : string seq
Returns: string
|
The select list of a grouped query: the key columns (`keys`, in the order of the groupings' Keys) of each grouping that selects its keys, then the aggregates.
|
Full Usage:
initCallSproc dc def values con com hasStoredProcedures
Parameters:
ISqlDataContext
def : RunTimeSprocDefinition
values : obj array
con : IDbConnection
com : IDbCommand
hasStoredProcedures : bool
Returns: QueryParameter array * SqlEntity * ('a -> SqlEntity[])
Type parameters: 'a, 'b, 'c (requires :> 'b Microsoft.FSharp.Collections.seq and :> (Microsoft.FSharp.Core.string * 'c) Microsoft.FSharp.Collections.seq) |
|
Full Usage:
parseHaving fieldNotation keys conditionList
Parameters:
'a
keys : (alias * SqlColumnType) list
conditionList : Condition list
Returns: Condition list
Type parameters: 'a |
|
|
Refuses OnConflict.DoNothingOn and UpdateOn where the database can't do them, saying why.
|
Full Usage:
searchDataTypeFromCache provider con sqlQuery baseAlias baseTable alias col
Parameters:
ISqlProvider
con : IDbConnection
sqlQuery : SqlQuery
baseAlias : string
baseTable : Table
alias : string
col : SqlColumnType
Returns: DbType voption
|
Check if we know primary column data type from cache. This helps matching parameter types if there are many different DBTypes mapped to same .NET type, like nvarchar and varchar to string.
|
Full Usage:
sortEntities entities
Parameters:
ConcurrentDictionary<SqlEntity, DateTime>
Returns: SqlEntity seq
Modifiers: inline |
deterministically sort entities before processing in a creation order, so that user can reliably save entities with foreign key relations
|