UNPKG

lubejs-mssql

Version:

The lubejs driver for mssql.

24 lines (23 loc) 1.31 kB
import mssql, { ISqlType, ISqlTypeFactory } from '@jovercao/mssql'; import { DbType, ISOLATION_LEVEL, Parameter, Raw, Scalar } from 'lubejs/core'; export declare function parseRawTypeToMssqlType(type: string): ISqlType; /** * 将类型转换为mssql库类型。 */ export declare function toMssqlType(type: DbType): mssql.ISqlType; export declare function toMssqlIsolationLevel(level: ISOLATION_LEVEL): number; export declare function sqlifyDbType(type: DbType | Raw): string; export declare function parseRawDbType(type: string): DbType; /** * 编译字面量 */ export declare function sqlifyLiteral(value: Scalar, dbType?: DbType): string; /** * 使mssql返回的数据类型符合lubejs类 */ export declare function normalDatas(datas: mssql.IRecordSet<any>): any[]; export declare function isSqlType(type: ISqlType | (() => mssql.ISqlType), expect: ISqlTypeFactory): boolean; export declare function prepareParameter(request: mssql.Request, p: Parameter): void; export declare const JSON_TYPE_PATTERN = ""; export declare function normalValue(value: any, type: ISqlType | (() => mssql.ISqlType)): any; export declare function isolationLevelToTSQL(isolationLevel: ISOLATION_LEVEL): "" | "READ UNCOMMITTED" | "READ COMMITTED" | "REPEATABLE READ" | "SERIALIZABLE" | "SNAPSHOT";