2021-04-29 21:17:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# This patch adds support for AS MATERIALIZED in Arel, see Gitlab::Database::AsWithMaterialized for more info
|
|
|
|
module Arel
|
|
|
|
module Visitors
|
|
|
|
class Arel::Visitors::PostgreSQL
|
|
|
|
def visit_Gitlab_Database_AsWithMaterialized(obj, collector) # rubocop:disable Naming/MethodName
|
|
|
|
collector = visit obj.left, collector
|
2021-06-08 01:23:25 +05:30
|
|
|
collector << " AS "
|
2021-04-29 21:17:54 +05:30
|
|
|
visit obj.right, collector
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|