UNPKG

@sqb/builder

Version:

Extensible multi-dialect SQL query builder written with TypeScript

17 lines (16 loc) 575 B
import { OperatorType } from '../../enums.js'; import { CompOperator } from './comp-operator.js'; export class OpLike extends CompOperator { _operatorType = OperatorType.like; _symbol = 'like'; constructor(left, right) { super(left, right); } __serialize(ctx, o) { if (!o.right.expression) return ''; if (o.right && typeof o.right.expression !== 'string') o.right.expression = String(o.right.expression); return ctx.serialize(this._type, o, (_ctx, _o) => this.__defaultSerialize(_ctx, _o)); } }