UNPKG

@sqb/builder

Version:

Extensible multi-dialect SQL query builder written with TypeScript

17 lines (16 loc) 593 B
import { OperatorType } from '../../enums.js'; import { CompOperator } from './comp-operator.js'; export class OpLike extends CompOperator { constructor(left, right) { super(left, right); this._operatorType = OperatorType.like; this._symbol = 'like'; } __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)); } }