Module: Db

Database related operations

Source:

Methods

(method) CreateConnection(connectionString, withContext) → {IDbConnection}

Create database connection

Parameters:
Name Type Description
connectionString string

Connection string

withContext bool

With context

Source:
Returns:
  • Connection
Type
IDbConnection

(method) CreateContext(sender, e)

Create database context with current user and language

Parameters:
Name Type Description
sender object

Sender

e StateChangeEventArgs

Event arguments

Source:

(method) ExecuteAsync(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<string>}

Execute asynchroneously

Parameters:
Name Type Description
cmd string

Command

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) ImportExcel(filename, sheet, preprocess, file, procName, pars, connectionString, withContext) → {Task.<string>}

Imports excel file into database

Parameters:
Name Type Description
filename string

Name of the file

sheet string

Name of the sheet (can be null)

preprocess string

Name of the function that preprocesses the data

file Stream

Data stream

procName string

procedure what handles JSON data

pars string

function parameters in JSON format,

connectionString string
withContext bool

With context

Source:
Returns:
  • Status of the operation
Type
Task.<string>

(method) IsFunctionSafe(procName, connectionString) → {Task.<string>}

Check if the function can be safely called

Parameters:
Name Type Description
procName string

Name of the function

connectionString string

Connection string

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) List(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<T>}

Query list of type T asyncronously

Parameters:
Name Type Description
cmd string

Command returning recordset compatible with T. Must return TABLE.

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<T>

(method) NormalizeProcedureName(procName) → {string}

Normalize procedure name

Parameters:
Name Type Description
procName string

Procedure name

Source:
Returns:
  • Normalized procedure name
Type
string

(method) QueryAsync(cmd, paramObject, connectionString, withContext, multiple, camelCase, keys, keyExpr, tableNames, cmdType) → {Task.<string>}

Query asynchroneously

Parameters:
Name Type Description
cmd string

Command returning table

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

multiple bool

Multiple

camelCase bool

Camel case

keys HashSet.<string>

Keys

keyExpr string

Key expression

tableNames Array.<string>

Table names

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryAsyncCached(cmd, paramObject, connectionString, cacheType, withContext, multiple, camelCase, keys, keyExpr, tableNames, cmdType) → {Task.<string>}

Query asynchroneously with caching

Parameters:
Name Type Description
cmd string

Command returning table

paramObject object

Parameters

connectionString string

Connection string

cacheType string

Cache type

withContext bool

With context

multiple bool

Multiple

camelCase bool

Camel case

keys HashSet.<string>

Keys

keyExpr string

Key expression

tableNames Array.<string>

Table names

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryAsyncFrugal(cmd, paramObject, connectionString, withContext, multiple, camelCase, keys, keyExpr, tableNames, cmdType) → {Task.<string>}

Query asynchroneously

Parameters:
Name Type Description
cmd string

Command returning frugal table (optimized for large tables)

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

multiple bool

Multiple

camelCase bool

Camel case

keys HashSet.<string>

Keys

keyExpr string

Key expression

tableNames Array.<string>

Table names

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryAsyncFrugalCached(cmd, paramObject, connectionString, cacheType, withContext, multiple, camelCase, keys, keyExpr, tableNames, cmdType) → {Task.<string>}

Query asynchroneously with caching

Parameters:
Name Type Description
cmd string

Command returning frugal table (optimized for large tables)

paramObject object

Parameters

connectionString string

Connection string

cacheType string

Cache type

withContext bool

With context

multiple bool

Multiple

camelCase bool

Camel case

keys HashSet.<string>

Keys

keyExpr string

Key expression

tableNames Array.<string>

Table names

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryByteAsync(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<Array.<byte>>}

Query byte array asynchroneously

Parameters:
Name Type Description
cmd string

Command returning byte array

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<Array.<byte>>

(method) QueryJsonAsync(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<string>}

Query json asynchroneously

Parameters:
Name Type Description
cmd string

Command returning json

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryJsonAsyncCached(cmd, paramObject, connectionString, cacheType, withContext, cmdType) → {Task.<string>}

Query json asynchroneously with caching

Parameters:
Name Type Description
cmd string

Command returning json

paramObject object

Parameters

connectionString string

Connection string

cacheType string

Cache type

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryScalarAsync(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<string>}

Query scalar asynchroneously

Parameters:
Name Type Description
cmd string

Command returning scalar

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryScalarAsyncCached(cmd, paramObject, connectionString, cacheType, withContext, cmdType) → {Task.<string>}

Query scalar asynchroneously cached

Parameters:
Name Type Description
cmd string

Command returning scalar

paramObject object

Parameters

connectionString string

Connection string

cacheType string

type of cache e.g. long, short etc.

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QuerySingleAsync(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<string>}

Query single row asynchroneously

Parameters:
Name Type Description
cmd string

Command returning single row

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QuerySingleAsyncCached(cmd, paramObject, connectionString, cacheType, withContext, cmdType) → {Task.<string>}

Query single row asynchroneously cached

Parameters:
Name Type Description
cmd string

Command returning single row

paramObject object

Parameters

connectionString string

Connection string

cacheType string

type of cache e.g. long, short etc.

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<string>

(method) QueryTableAsync(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<DataTable>}

Query table asynchroneously

Parameters:
Name Type Description
cmd string

Command returning reader

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<DataTable>

(method) Task(cmd, paramObject, connectionString, withContext, cmdType) → {Task.<T>}

Query single object of type T asyncronously

Parameters:
Name Type Description
cmd string

Command returning single row compatible with T. Must return TABLE.

paramObject object

Parameters

connectionString string

Connection string

withContext bool

With context

cmdType CommandType

Command type

Source:
Returns:
  • Result of the operation
Type
Task.<T>