2021-03-24 08:09:32 -04:00
|
|
|
# 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-05-04 08:10:04 -04:00
|
|
|
collector << " AS "
|
2021-03-24 08:09:32 -04:00
|
|
|
visit obj.right, collector
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|