public override string BuildSql(SqlOptions sqlOptions) { var left = LeftOperand.BuildSql(sqlOptions, FlowOptions.Construct(this)); var right = RightOperand.BuildSql(sqlOptions, FlowOptions.Construct(this)); var command = sqlOptions.Command("LIKE"); return($"{left} {command} {right}"); }
public override string BuildSql(SqlOptions sqlOptions) { var left = LeftOperand.BuildSql(sqlOptions, FlowOptions.Construct(this)); var right = RightOperand.BuildSql(sqlOptions, FlowOptions.Construct(this)); switch (sqlOptions.DatabaseType) { case SqlDatabaseType.Postgres: return($"{left} = {sqlOptions.Command("ANY")}({right})"); default: return($"{left} {sqlOptions.Command("IN")} ({right})"); } }
public override string BuildSql(SqlOptions sqlOptions) { switch (sqlOptions.DatabaseType) { case SqlDatabaseType.Postgres: { var left = LeftOperand.BuildSql(sqlOptions, FlowOptions.Construct(this)); var right = RightOperand.BuildSql(sqlOptions, FlowOptions.Construct(this)); var command = sqlOptions.Command("ILIKE"); return($"{left} {command} {right}"); } default: { return(new LikeOperator(LeftOperand.Lower(), RightOperand.Lower()).BuildSql(sqlOptions, FlowOptions.Construct(this))); } } }