database-builder
Version:
Library to assist in creating and maintaining SQL commands.
21 lines (20 loc) • 1.2 kB
TypeScript
import { ValueType, ValueTypeToParse } from "./core/utils";
import { FieldType } from "./core/enums/field-type";
import { ColumnType } from "./core/enums/column-type";
export declare class DatabaseHelper {
isFlag(value: any, flag: any): boolean;
isTypeSimpleByType(type: FieldType): boolean;
isTypeSimple(value: ValueTypeToParse): boolean;
isTypeIgnoredInMapperByType(type: FieldType): boolean;
isTypeIgnoredInMapper(value: ValueTypeToParse): boolean;
getFieldType<T>(type: string | (new () => T), constructorName?: string): FieldType;
getType(value: ValueTypeToParse): FieldType;
parseToColumnType(type: FieldType): ColumnType;
parseToValueType(value: ValueTypeToParse, type?: FieldType): ValueType;
preFormatValue(value: ValueTypeToParse, type?: FieldType): ValueTypeToParse;
databaseToValue(columnValue: any, fieldType: FieldType): any;
toBoolean(value: string | number | boolean): boolean;
valueToDatabase(value: ValueTypeToParse, fieldType: FieldType): ValueType;
getValue(instance: any, fieldReference: string): ValueTypeToParse;
getValueByProperties(instance: any, properties: string[]): ValueTypeToParse;
}