From af545ece2af2e5485b257f650acbe82f8300008c Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Fri, 24 May 2024 20:32:45 +0100 Subject: [PATCH] Syntax for with recursive slightly different in SQL Server --- lib/arel/visitors/sqlserver.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/arel/visitors/sqlserver.rb b/lib/arel/visitors/sqlserver.rb index 8392eb102..3dfe35bbe 100644 --- a/lib/arel/visitors/sqlserver.rb +++ b/lib/arel/visitors/sqlserver.rb @@ -203,6 +203,11 @@ def collect_optimizer_hints(o, collector) collector end + def visit_Arel_Nodes_WithRecursive(o, collector) + collector << "WITH " + collect_ctes(o.children, collector) + end + # SQLServer ToSql/Visitor (Additions) def visit_Arel_Nodes_SelectStatement_SQLServer_Lock(collector, options = {})