Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
return params
}
/** SQL Service **/
const sqlService = {
// SQL type-mapping adapter. Add new types as required.
TYPES: {
BigInt: mssql.BigInt,
Bit: mssql.Bit,
Char: mssql.Char,
DateTimeOffset: mssql.DateTimeOffset,
DateTime: mssql.DateTime,
DateTime2: mssql.DateTime2,
Decimal: mssql.Decimal,
Float: mssql.Float,
Int: mssql.Int,
Numeric: mssql.Numeric,
NVarChar: mssql.NVarChar,
Real: mssql.Real,
SmallInt: mssql.SmallInt,
UniqueIdentifier: mssql.UniqueIdentifier
}
}
// Name of the admin database
sqlService.adminSchema = '[mtc_admin]'
sqlService.initPool = async () => {
if (pool) {
logger.warn('The connection pool has already been initialised')
return
}
return params
}
/** SQL Service **/
const sqlService = {
// SQL type-mapping adapter. Add new types as required.
TYPES: {
BigInt: mssql.BigInt,
Bit: mssql.Bit,
Char: mssql.Char,
DateTimeOffset: mssql.DateTimeOffset,
DateTime: mssql.DateTime,
DateTime2: mssql.DateTime2,
Decimal: mssql.Decimal,
Float: mssql.Float,
Int: mssql.Int,
Numeric: mssql.Numeric,
NVarChar: mssql.NVarChar,
Real: mssql.Real,
SmallInt: mssql.SmallInt,
UniqueIdentifier: mssql.UniqueIdentifier
}
}
// Name of the admin database
sqlService.adminSchema = '[mtc_admin]'
sqlService.initPool = async () => {
if (pool) {
logger.warn('The connection pool has already been initialised')
return
options
})
}
return params
}
/** SQL Service **/
const sqlService = {
// SQL type-mapping adapter. Add new types as required.
TYPES: {
BigInt: mssql.BigInt,
Bit: mssql.Bit,
Char: mssql.Char,
DateTimeOffset: mssql.DateTimeOffset,
Decimal: mssql.Decimal,
Float: mssql.Float,
Int: mssql.Int,
Numeric: mssql.Numeric,
NVarChar: mssql.NVarChar,
Real: mssql.Real,
SmallInt: mssql.SmallInt,
UniqueIdentifier: mssql.UniqueIdentifier
}
}
// Name of the admin database
sqlService.adminSchema = '[mtc_admin]'
sqlService.initPool = async () => {
if (pool) {
logger.warn('The connection pool has already been initialised')
return
switch (type) {
case 'number':
request.input(param.name, value % 1 === 0 ? database.Int : database.Decimal, value);
break;
case 'decimal':
request.input(param.name, database.Decimal, value);
break;
case 'uniqueidentifier':
case 'guid':
request.input(param.name, database.UniqueIdentifier, value);
break;
case 'money':
request.input(param.name, database.Money, value);
break;
case 'float':
request.input(param.name, database.Float, value);
break;
case 'bigint':
request.input(param.name, database.BigInt, value);
break;
case 'smallint':
case 'byte':
request.input(param.name, database.SmallInt, value);
break;
case 'string':
case 'nvarchar':
request.input(param.name, database.NVarChar, value);
break;
case 'boolean':
case 'bit':
request.input(param.name, database.Bit, value);
break;
switch (type) {
case 'number':
request.input(param.name, value % 1 === 0 ? database.Int : database.Float, value);
break;
case 'decimal':
request.input(param.name, database.Decimal, value);
break;
case 'uniqueidentifier':
case 'guid':
request.input(param.name, database.UniqueIdentifier, value);
break;
case 'money':
request.input(param.name, database.Money, value);
break;
case 'float':
request.input(param.name, database.Float, value);
break;
case 'bigint':
request.input(param.name, database.BigInt, value);
break;
case 'smallint':
case 'byte':
request.input(param.name, database.SmallInt, value);
break;
case 'string':
case 'nvarchar':
request.input(param.name, database.NVarChar, value);
break;
case 'boolean':
case 'bit':
request.input(param.name, database.Bit, value);
break;