UNPKG

tspace-mysql

Version:

Tspace MySQL is a promise-based ORM for Node.js, designed with modern TypeScript and providing type safety for schema databases.

61 lines (60 loc) 2.5 kB
import { DB } from './DB'; import { Model } from './Model'; /** * The 'Operator' class is used to operator for where conditions. * @example * import { Operator , DB } from 'tspace-mysql' * * const whereObject = await new DB("users") * .whereObject({ * id : Operator.eq(1), * username : Operator.orIn(['user1','user2']), * name : Operator.like('%value%') * }) * .findMany(); */ export declare class Operator { private static _handlerResult; static eq(value: string | number | boolean): `$OP:${string}`; static notEq(value: string | number | boolean): `$OP:${string}`; static more(value: string | number): `$OP:${string}`; static less(value: string | number): `$OP:${string}`; static moreOrEq(value: string | number): `$OP:${string}`; static lessOrEq(value: string | number): `$OP:${string}`; static like(value: string | number): `$OP:${string}`; static notLike(value: string | number): `$OP:${string}`; static in(value: (string | number | boolean | null)[]): `$OP:${string}`; static notIn(value: (string | number | boolean | null)[]): `$OP:${string}`; static isNull(): `$OP:${string}`; static isNotNull(): `$OP:${string}`; static query(value: string): `$OP:${string}`; static subQuery(value: string | Model | DB): `$OP:${string}`; static orEq(value: string | number | boolean): `$OP:${string}`; static orNotEq(value: string | number | boolean): `$OP:${string}`; static orMore(value: string | number): `$OP:${string}`; static orLess(value: string | number): `$OP:${string}`; static orMoreOrEq(value: string | number): `$OP:${string}`; static orLessOrEq(value: string | number): `$OP:${string}`; static orLike(value: string | number): `$OP:${string}`; static orNotLike(value: string | number): `$OP:${string}`; static orIn(value: (string | number | boolean | null)[]): `$OP:${string}`; static orNotIn(value: (string | number | boolean | null)[]): `$OP:${string}`; static orIsNull(): `$OP:${string}`; static orIsNotNull(): `$OP:${string}`; static orQuery(value: string): `$OP:${string}`; } /** * The 'OP' class is used to operator for where conditions. * @example * import { OP , DB } from 'tspace-mysql' * * const whereObject = await new DB("users") * .whereObject({ * id : OP.eq(1), * username : OP.orIn(['user1','user2']), * name : OP.like('%value%') * }) * .findMany(); */ export declare class OP extends Operator { }