import { EntityDict, Q_FullTextValue, RefOrExpression, Ref, StorageSchema, Attribute } from "oak-domain/lib/types"; import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain'; import { DataType } from "oak-domain/lib/types/schema/DataTypes"; import { SqlOperateOption, SqlSelectOption, SqlTranslator } from "../sqlTranslator"; import { CreateEntityOption } from '../types/Translator'; export interface MySqlSelectOption extends SqlSelectOption { } export interface MysqlOperateOption extends SqlOperateOption { } export declare class MySqlTranslator extends SqlTranslator { readonly maxIndexNameLength = 64; private escapeSqlCommentLiteral; getPhysicalIndexName(entityName: string, tableName: string, logicalName: string, suffix?: string): string; getLegacyPhysicalIndexNames(entityName: string, tableName: string, logicalName: string, suffix?: string): string[]; protected getDefaultSelectFilter(alias: string, option?: MySqlSelectOption): string; private normalizeMySqlIndexConfig; private makeUpSchema; constructor(schema: StorageSchema); static supportedDataTypes: DataType[]; static spatialTypes: DataType[]; static withLengthDataTypes: DataType[]; static withPrecisionDataTypes: DataType[]; static withScaleDataTypes: DataType[]; static unsignedAndZerofillTypes: DataType[]; static withWidthDataTypes: DataType[]; static dataTypeDefaults: { varchar: { length: number; }; nvarchar: { length: number; }; "national varchar": { length: number; }; char: { length: number; }; binary: { length: number; }; varbinary: { length: number; }; decimal: { precision: number; scale: number; }; dec: { precision: number; scale: number; }; numeric: { precision: number; scale: number; }; fixed: { precision: number; scale: number; }; float: { precision: number; }; double: { precision: number; }; time: { precision: number; }; datetime: { precision: number; }; timestamp: { precision: number; }; bit: { width: number; }; int: { width: number; }; integer: { width: number; }; tinyint: { width: number; }; smallint: { width: number; }; mediumint: { width: number; }; bigint: { width: number; }; }; maxAliasLength: number; private populateDataTypeDef; protected translateAttrProjection(dataType: DataType, alias: string, attr: string): string; protected translateObjectPredicate(predicate: Record, alias: string, attr: string): string; protected translateObjectProjection(projection: Record, alias: string, attr: string, prefix: string, resultColumnMap: Record): string; protected translateAttrValue(dataType: DataType | Ref, value: any): string; protected translateAttributePredicate(column: string, predicate: string, value: any, type?: DataType | Ref): string; protected translateFullTextSearch(value: Q_FullTextValue, entity: T, alias: string): string; translateAttributeDef(attr: string, attrDef: Attribute): string; translateColumnDefinition(entity: string, attr: string, attrDef: Attribute): string; translateCreateEntity(entity: T, options?: CreateEntityOption): string[]; private translateFnName; private translateAttrInExpression; protected translateExpression(entity: T, alias: string, expression: RefOrExpression, refDict: Record): string; translateUpdate(entity: T, operation: ED[T]['Update'], option?: OP): { sql: string; resultColumnMap: {}; }; protected populateSelectStmt(projectionText: string, fromText: string, aliasDict: Record, filterText: string, sorterText?: string, groupByText?: string, indexFrom?: number, count?: number, option?: MySqlSelectOption): string; protected populateUpdateStmt(updateText: string, fromText: string, aliasDict: Record, filterText: string, sorterText?: string, indexFrom?: number, count?: number, option?: MysqlOperateOption): string; protected populateRemoveStmt(updateText: string, fromText: string, aliasDict: Record, filterText: string, sorterText?: string, indexFrom?: number, count?: number, option?: MysqlOperateOption): string; /** * 将MySQL返回的Type回译成oak的类型,是 populateDataTypeDef 的反函数 * @param type */ reTranslateToAttribute(type: string): Attribute; readSchema(execFn: (sql: string) => Promise): Promise>; }