import { Binary, BuiltIn, XExpression, DbType, Expression, Scalar, ScalarFromDbType, Star, Numeric, Execute } from 'lubejs/core'; declare type InvokeHandler0 = () => Expression; declare type InvokeHandler1 = (expr: XExpression) => Expression; declare type InvokeHandler2 = (expr1: XExpression, expr2: XExpression) => Expression; export declare type DatePart = BuiltIn; export declare const count: (expr: XExpression | Star) => Expression; export declare const avg: (expr: XExpression) => Expression; export declare const sum: (expr: XExpression) => Expression; export declare const max: >(expr: Expression) => Expression; export declare const min: >(expr: Expression) => Expression; export declare const exp: InvokeHandler1; export declare const round: (expr: XExpression, precision: XExpression) => Expression; export declare const nvl: (expr: XExpression, default_value: XExpression) => Expression; export declare const stdev: InvokeHandler1; export declare const dateName: (part: DatePart, date: XExpression) => Expression; export declare const datePart: (part: DatePart, date: XExpression) => Expression; export declare const isNull: (expr: XExpression, default_value: XExpression) => Expression; export declare const len: InvokeHandler1; export declare const getDate: InvokeHandler0; export declare const getUtcDate: InvokeHandler0; export declare const month: InvokeHandler1; export declare const year: InvokeHandler1; export declare const day: InvokeHandler1; export declare const dateAdd: (part: DatePart, increment: XExpression, date: XExpression) => Expression; export declare const dateDiff: (part: DatePart, startDate: XExpression, endDate: XExpression) => Expression; export declare const sysDateTime: InvokeHandler0; export declare const sysUtcDateTime: InvokeHandler0; export declare const sysDateTimeOffset: InvokeHandler0; export declare const switchOffset: (date: XExpression, time_zone: XExpression) => Expression; export declare const charIndex: (pattern: XExpression, str: XExpression, startIndex?: XExpression) => Expression; export declare const left: (str: XExpression, length: XExpression) => Expression; export declare const right: (str: XExpression, length: XExpression) => Expression; export declare const str: InvokeHandler1; export declare const substring: (expr: XExpression, start: XExpression, length: XExpression) => Expression; export declare const ascii: InvokeHandler1; export declare const unicode: InvokeHandler1; export declare const char: InvokeHandler1; export declare const nchar: InvokeHandler1; export declare const patIndex: (pattern: XExpression, str: XExpression) => Expression; export declare const ltrim: InvokeHandler1; export declare const rtrim: InvokeHandler1; export declare const space: InvokeHandler1; export declare const reverse: InvokeHandler1; export declare const stuff: (expression_to_be_searched: XExpression, starting_position: XExpression, number_of_chars: XExpression, replacement_expression: XExpression) => Expression; export declare const quotedName: InvokeHandler1; export declare const lower: InvokeHandler1; export declare const upper: InvokeHandler1; export declare const replace: (expression_to_be_searched: XExpression, search_expression: XExpression, replacement_expression: XExpression) => Expression; export declare const abs: InvokeHandler1; export declare const acos: InvokeHandler1; export declare const asin: InvokeHandler1; export declare const atan: InvokeHandler1; export declare const atan2: InvokeHandler1; export declare const ceiling: InvokeHandler1; export declare const cos: InvokeHandler1; export declare const cot: InvokeHandler1; export declare const degrees: InvokeHandler1; export declare const floor: InvokeHandler1; export declare const log: InvokeHandler1; export declare const log10: InvokeHandler1; export declare const pi: InvokeHandler0; export declare const power: InvokeHandler2; export declare const radians: InvokeHandler1; export declare const rand: InvokeHandler0; export declare const sign: InvokeHandler1; export declare const sin: InvokeHandler1; export declare const sqrt: InvokeHandler1; export declare const square: InvokeHandler1; export declare const tan: InvokeHandler1; /** * 系统函数声明 */ export declare const FUNCTION: { count: (expr: XExpression | Star) => Expression; avg: (expr: XExpression) => Expression; sum: (expr: XExpression) => Expression; max: | null>(expr: Expression) => Expression; min: | null>(expr: Expression) => Expression; abs: InvokeHandler1; exp: InvokeHandler1; round: (expr: XExpression, precision: XExpression) => Expression; floor: InvokeHandler1; sqrt: InvokeHandler1; power: InvokeHandler2; nvl: (expr: XExpression, default_value: XExpression) => Expression; stdev: InvokeHandler1; square: InvokeHandler1; dateName: (part: DatePart, date: XExpression) => Expression; datePart: (part: DatePart, date: XExpression) => Expression; isNull: (expr: XExpression, default_value: XExpression) => Expression; len: InvokeHandler1; getDate: InvokeHandler0; getUtcDate: InvokeHandler0; month: InvokeHandler1; year: InvokeHandler1; dateAdd: (part: DatePart, increment: XExpression, date: XExpression) => Expression; dateDiff: (part: DatePart, startDate: XExpression, endDate: XExpression) => Expression; sysDateTime: InvokeHandler0; sysUtcDateTime: InvokeHandler0; charIndex: (pattern: XExpression, str: XExpression, startIndex?: XExpression | undefined) => Expression; left: (str: XExpression, length: XExpression) => Expression; right: (str: XExpression, length: XExpression) => Expression; str: InvokeHandler1; substring: (expr: XExpression, start: XExpression, length: XExpression) => Expression; ascii: InvokeHandler1; char: InvokeHandler1; unicode: InvokeHandler1; nchar: InvokeHandler1; patIndex: (pattern: XExpression, str: XExpression) => Expression; ltrim: InvokeHandler1; rtrim: InvokeHandler1; space: InvokeHandler1; reverse: InvokeHandler1; stuff: (expression_to_be_searched: XExpression, starting_position: XExpression, number_of_chars: XExpression, replacement_expression: XExpression) => Expression; quotedName: InvokeHandler1; lower: InvokeHandler1; upper: InvokeHandler1; replace: (expression_to_be_searched: XExpression, search_expression: XExpression, replacement_expression: XExpression) => Expression; rand: InvokeHandler0; acos: InvokeHandler1; asin: InvokeHandler1; atan: InvokeHandler1; atan2: InvokeHandler1; ceiling: InvokeHandler1; cos: InvokeHandler1; cot: InvokeHandler1; degrees: InvokeHandler1; log: InvokeHandler1; log10: InvokeHandler1; pi: InvokeHandler0; radians: InvokeHandler1; sign: InvokeHandler1; sin: InvokeHandler1; tan: InvokeHandler1; }; export declare const YEAR: BuiltIn<"YEAR">; export declare const YY: BuiltIn<"YY">; export declare const YYYY: BuiltIn<"YYYY">; export declare const QUARTER: BuiltIn<"QUARTER">; export declare const QQ: BuiltIn<"QQ">; export declare const Q: BuiltIn<"Q">; export declare const MONTH: BuiltIn<"MONTH">; export declare const MM: BuiltIn<"MM">; export declare const M: BuiltIn<"M">; export declare const DAYOFYEAR: BuiltIn<"DAYOFYEAR">; export declare const DY: BuiltIn<"DY">; export declare const Y: BuiltIn<"Y">; export declare const DAY: BuiltIn<"DAY">; export declare const DD: BuiltIn<"DD">; export declare const D: BuiltIn<"D">; export declare const WEEK: BuiltIn<"WEEK">; export declare const WK: BuiltIn<"WK">; export declare const WW: BuiltIn<"WW">; export declare const WEEKDAY: BuiltIn<"WEEKDAY">; export declare const DW: BuiltIn<"DW">; export declare const HOUR: BuiltIn<"HOUR">; export declare const HH: BuiltIn<"HH">; export declare const MINUTE: BuiltIn<"MINUTE">; export declare const MI: BuiltIn<"MI">; export declare const N: BuiltIn<"N">; export declare const SECOND: BuiltIn<"SECOND">; export declare const SS: BuiltIn<"SS">; export declare const S: BuiltIn<"S">; export declare const MILLISECOND: BuiltIn<"MILLISECOND">; export declare const MS: BuiltIn<"MS">; /** * 日期格式部分 */ export declare const DATE_PART: { YEAR: BuiltIn<"YEAR">; YY: BuiltIn<"YY">; YYYY: BuiltIn<"YYYY">; QUARTER: BuiltIn<"QUARTER">; QQ: BuiltIn<"QQ">; Q: BuiltIn<"Q">; MONTH: BuiltIn<"MONTH">; MM: BuiltIn<"MM">; M: BuiltIn<"M">; DAYOFYEAR: BuiltIn<"DAYOFYEAR">; DY: BuiltIn<"DY">; Y: BuiltIn<"Y">; DAY: BuiltIn<"DAY">; DD: BuiltIn<"DD">; D: BuiltIn<"D">; WEEK: BuiltIn<"WEEK">; WK: BuiltIn<"WK">; WW: BuiltIn<"WW">; WEEKDAY: BuiltIn<"WEEKDAY">; DW: BuiltIn<"DW">; HOUR: BuiltIn<"HOUR">; HH: BuiltIn<"HH">; MINUTE: BuiltIn<"MINUTE">; MI: BuiltIn<"MI">; N: BuiltIn<"N">; SECOND: BuiltIn<"SECOND">; SS: BuiltIn<"SS">; S: BuiltIn<"S">; MILLISECOND: BuiltIn<"MILLISECOND">; MS: BuiltIn<"MS">; }; /** * 最后一次插入数据的标识列值 */ export declare const IDENTITY: import("lubejs/core").Variant; /** * 最后一次执行受影响函数 */ export declare const ROWCOUNT: import("lubejs/core").Variant; /** * 返回自上次启动 Microsoft SQL Server以来连接或试图连接的次数。 */ export declare const CONNECTIONS: import("lubejs/core").Variant; /** * 返回自上次启动 Microsoft SQL Server以来 CPU 的工作时间,单位为毫秒(基于系统计时器的分辨率)。 */ export declare const CPU_BUSY: import("lubejs/core").Variant; /** * 返回 SET DATEFIRST 参数的当前值,SET DATEFIRST 参数指明所规定的每周第一天:1 对应星期一,2 对应星期二,依次类推,用 7 对应星期日。 */ export declare const DATEFIRST: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后用于执行输入和输出操作的时间,单位为毫秒(基于系统计时器的分辨率)。 */ export declare const IO_BUSY: import("lubejs/core").Variant; /** * 返回当前所使用语言的本地语言标识符(ID)。 */ export declare const LANGID: import("lubejs/core").Variant; /** * 返回当前使用的语言名。 */ export declare const LANGUAGE: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server上允许的同时用户连接的最大数。返回的数不必为当前配置的数值。 */ export declare const MAX_CONNECTIONS: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后从网络上读取的输入数据包数目。 */ export declare const PACK_RECEIVED: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后写到网络上的输出数据包数目。 */ export declare const PACK_SENT: import("lubejs/core").Variant; /** * 返回自 SQL Server 上次启动后,在 Microsoft SQL Server连接上发生的网络数据包错误数。 */ export declare const PACKET_ERRORS: import("lubejs/core").Variant; /** * 返回运行 Microsoft SQL Server的本地服务器名称。 */ export declare const SERVERNAME: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server正在其下运行的注册表键名。若当前实例为默认实例,则 @SERVICENAME 返回 MSSQLServer;若当前实例是命名实例,则该函数返回实例名。 */ export declare const SERVICENAME: import("lubejs/core").Variant; /** * 返回当前用户进程的服务器进程标识符 (ID)。 */ export declare const SPID: import("lubejs/core").Variant; /** * 返回一刻度的微秒数。 */ export declare const TIMETICKS: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后,所遇到的磁盘读/写错误数。 */ export declare const TOTAL_ERRORS: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后写入磁盘的次数。 */ export declare const TOTAL_WRITE: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server当前安装的日期、版本和处理器类型。 */ export declare const VERSION: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后读取磁盘(不是读取高速缓存)的次数。 */ export declare const TOTAL_READ: import("lubejs/core").Variant; /** * 系统变量 */ export declare const VARIANTS: { /** * 最后一次插入数据的标识列值 */ IDENTITY: import("lubejs/core").Variant; /** * 最后一次执行受影响函数 */ ROWCOUNT: import("lubejs/core").Variant; /** * 返回自上次启动 Microsoft SQL Server以来连接或试图连接的次数。 */ CONNECTIONS: import("lubejs/core").Variant; /** * 返回自上次启动 Microsoft SQL Server以来 CPU 的工作时间,单位为毫秒(基于系统计时器的分辨率)。 */ CPU_BUSY: import("lubejs/core").Variant; /** * 返回 SET DATEFIRST 参数的当前值,SET DATEFIRST 参数指明所规定的每周第一天:1 对应星期一,2 对应星期二,依次类推,用 7 对应星期日。 */ DATEFIRST: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后用于执行输入和输出操作的时间,单位为毫秒(基于系统计时器的分辨率)。 */ IO_BUSY: import("lubejs/core").Variant; /** * 返回当前所使用语言的本地语言标识符(ID)。 */ LANGID: import("lubejs/core").Variant; /** * 返回当前使用的语言名。 */ LANGUAGE: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server上允许的同时用户连接的最大数。返回的数不必为当前配置的数值。 */ MAX_CONNECTIONS: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后从网络上读取的输入数据包数目。 */ PACK_RECEIVED: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后写到网络上的输出数据包数目。 */ PACK_SENT: import("lubejs/core").Variant; /** * 返回自 SQL Server 上次启动后,在 Microsoft SQL Server连接上发生的网络数据包错误数。 */ PACKET_ERRORS: import("lubejs/core").Variant; /** * 返回运行 Microsoft SQL Server的本地服务器名称。 */ SERVERNAME: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server正在其下运行的注册表键名。若当前实例为默认实例,则 @SERVICENAME 返回 MSSQLServer;若当前实例是命名实例,则该函数返回实例名。 */ SERVICENAME: import("lubejs/core").Variant; /** * 返回当前用户进程的服务器进程标识符 (ID)。 */ SPID: import("lubejs/core").Variant; /** * 返回一刻度的微秒数。 */ TIMETICKS: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后,所遇到的磁盘读/写错误数。 */ TOTAL_ERRORS: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后写入磁盘的次数。 */ TOTAL_WRITE: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server当前安装的日期、版本和处理器类型。 */ VERSION: import("lubejs/core").Variant; /** * 返回 Microsoft SQL Server自上次启动后读取磁盘(不是读取高速缓存)的次数。 */ TOTAL_READ: import("lubejs/core").Variant; }; export declare const MssqlDbType: { bit: any; decimal(p: number, s?: number | undefined): DbType; numeric(p: number, s?: number | undefined): DbType; money: any; smallmoney: any; tinyint: any; smallint: any; int: any; bigint: any; float: ((n: number) => DbType) & DbType; real: any; date: any; time: ((s: number) => DbType) & DbType; datetime: any; smalldatetime: any; datetime2: ((p: number) => DbType) & DbType; datetimeoffset: ((p?: number | undefined) => DbType) & DbType; char: ((l: number) => DbType) & DbType; nchar: ((l: number) => DbType) & DbType; varchar: ((l: number) => DbType) & DbType; nvarchar: ((l: number) => DbType) & DbType; /** * @deprecated 该类型在未来版本将被删除 */ text: any; /** * @deprecated 该类型在未来版本将被删除 */ ntext: any; /** * @deprecated 该类型在未来版本将被删除 */ image: any; binary: ((l: number) => DbType) & DbType; varbinary: ((l?: number | "max" | "MAX" | undefined) => DbType) & DbType; }; export declare type SQL_VARIANT = { name: 'sql_variant' | 'sv'; }; export declare type SV = SQL_VARIANT; export declare type INTEGER = { name: 'int' | 'integer'; }; export declare type INT = INTEGER; export declare type BIGINT = { name: 'bint' | 'bigint'; }; export declare type BINT = BIGINT; export declare type SMALLINT = { name: 'smallint' | 'sint'; }; export declare type SINT = SMALLINT; export declare type TINYINT = { name: 'tinyint' | 'tint'; }; export declare type TINT = TINYINT; export declare type DECIMAL = { name: 'decimal' | 'dec'; precision: number; digit?: number; }; export declare type DEC = DECIMAL; export declare type NUMERIC = { name: 'numeric' | 'num'; precision: number; digit?: number; }; export declare type NUM = NUMERIC; export declare type REAL = { name: 'real' | 'r'; }; export declare type R = REAL; export declare type FLOAT = { name: 'FLOAT32'; precision?: number; }; export declare type MONEY = { type: 'money' | 'mn'; }; export declare type MN = MONEY; export declare type SMALLMONEY = { name: 'smallmoney' | 'smn'; }; export declare type SMN = SMALLMONEY; export declare type CHAR = { name: 'char'; length: number; }; export declare type NCHAR = { name: 'nchar'; length: number; }; export declare type VARCHAR = { name: 'varchar'; length: number | 'MAX'; }; export declare type NVARCHAR = { name: 'nvarchar'; length: number | 'MAX'; }; export declare type SYSNAME = { name: 'sysname'; }; export declare type TEXT = { name: 'text'; length: number; }; export declare type NTEXT = { name: 'ntext'; length: number; }; export declare type DATATIME = { name: 'datatime'; }; export declare type SMALLDATATIME = { name: 'smalldatatime'; }; export declare type BINARY = { name: 'binary'; length: number; }; export declare type VARBINARY = { name: 'varbinary'; length: number; }; export declare type IMAGE = { name: 'image'; }; export declare type BIT = { name: 'bit'; }; export declare type MssqlDbType = SQL_VARIANT | INTEGER | INT | CHAR | VARCHAR | FLOAT | DECIMAL | BINARY | VARBINARY; export declare function convert(type: T, expr: XExpression, styleId?: XExpression): Expression>; export declare const format: (date: XExpression, format: XExpression) => Expression; /** * 获取当前数据库名称 */ export declare const db_name: () => Expression; /** * 获取当前架构名称 */ export declare const schema_name: () => Expression; /** * 获取对象ID */ export declare const object_id: (name: XExpression) => Expression; /** * 通过对象ID获取对象名称 */ export declare const object_name: (objectId: XExpression) => Expression; /** * 获取对象定义代码 */ export declare const object_definition: (objectId: XExpression) => Expression; /** * 获取数据库的上级ID */ export declare const database_principal_id: (dbName: XExpression) => Expression; /** * 获取数据库的上级ID */ export declare const db_id: (dbName: XExpression) => Expression; /** * 系统重命名函数 */ export declare const sp_rename: (name: string, newName: string, kind?: 'USERDATATYPE' | 'OBJECT' | 'COLUMN' | 'INDEX' | 'DATABASE') => Execute; export declare const sp_addextendedproperty: (name: string, value: string, level0Type: 'SCHEMA' | 'DATABASE', level0: string, level1Type?: 'TABLE' | 'PROCEDURE' | 'FUNCTION', level1?: string, level2Type?: 'CONSTRAINT' | 'COLUMN', level2?: string) => Execute; export declare const sp_dropextendedproperty: (name: string, level0Type: 'SCHEMA' | 'DATABASE', level0: string, level1Type?: 'TABLE' | 'PROCEDURE' | 'FUNCTION', level1?: string, level2Type?: 'CONSTRAINT' | 'COLUMN', level2?: string) => Execute; export declare const sp_updateextendedproperty: (name: string, value: string, level0Type: 'SCHEMA' | 'DATABASE', level0: string, level1Type?: 'TABLE' | 'PROCEDURE' | 'FUNCTION', level1?: string, level2Type?: 'CONSTRAINT' | 'COLUMN', level2?: string) => Execute; export {};