SQLProvider

CommonTasks Module

Functions and values

Function or value Description

``ensurecolumnshavebeenloaded`` provider con entities

Full Usage: ``ensurecolumnshavebeenloaded`` provider con entities

Parameters:

checkKey pkLookup id e

Full Usage: checkKey pkLookup id e

Parameters:
Type parameters: 'a
pkLookup : ConcurrentDictionary<string, string list>
id : 'a
e : SqlEntity

groupKeyColumn keys index column notation plain

Full Usage: groupKeyColumn keys index column notation plain

Parameters:
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, with trailing underscores until it differs from the names of the key's plain columns, ignoring case. Results are read by name: left unaliased, two computed keys come back under one name (PostgreSQL and SQL Server do not name them by their text), and a name shared with a plain key column loses one value, so the key tuple cannot be rebuilt. Every other key column keeps `plain`, the provider's usual entry.

keys : (alias * SqlColumnType) list
index : int
column : SqlColumnType
notation : string
plain : string
Returns: string

groupSelectColumns grouping keys aggregates

Full Usage: groupSelectColumns grouping keys aggregates

Parameters:
    grouping : 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.

grouping : GroupingColumns list
keys : string list
aggregates : string seq
Returns: string

initCallSproc dc def values con com hasStoredProcedures

Full Usage: initCallSproc dc def values con com hasStoredProcedures

Parameters:
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)
dc : ISqlDataContext
def : RunTimeSprocDefinition
values : obj array
con : IDbConnection
com : IDbCommand
hasStoredProcedures : bool
Returns: QueryParameter array * SqlEntity * ('a -> SqlEntity[])

parseHaving fieldNotation keys conditionList

Full Usage: parseHaving fieldNotation keys conditionList

Parameters:
Returns: Condition list
Type parameters: 'a
fieldNotation : 'a
keys : (alias * SqlColumnType) list
conditionList : Condition list
Returns: Condition list

searchDataTypeFromCache provider con sqlQuery baseAlias baseTable alias col

Full Usage: searchDataTypeFromCache provider con sqlQuery baseAlias baseTable alias col

Parameters:
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.

provider : ISqlProvider
con : IDbConnection
sqlQuery : SqlQuery
baseAlias : string
baseTable : Table
alias : string
col : SqlColumnType
Returns: DbType voption

sortEntities entities

Full Usage: sortEntities entities

Parameters:
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

entities : ConcurrentDictionary<SqlEntity, DateTime>
Returns: SqlEntity seq

Type something to start searching.