blob: c4e95284c50498b797e93d487cde84e867e84195 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# frozen_string_literal: true
module Gitlab
module SQL
# Class for building SQL UNION statements.
#
# By default ORDER BYs are dropped from the relations as the final sort
# order is not guaranteed any way.
#
# Example usage:
#
# union = Gitlab::SQL::Union.new([user.personal_projects, user.projects])
# sql = union.to_sql
#
# Project.where("id IN (#{sql})")
class Union < SetOperator
def self.operator_keyword
'UNION'
end
end
end
end
|