Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL. (#101768)

* Support Spanner's UNION syntax, which needs to be UNION DISTINCT or UNION ALL.
This commit is contained in:
Peter Štibraný
2025-03-10 12:33:52 +01:00
committed by GitHub
parent 607d39b573
commit fd6a4908f1
13 changed files with 46 additions and 23 deletions
+6 -2
View File
@@ -455,7 +455,9 @@ func (l *LibraryElementService) getAllLibraryElements(c context.Context, signedI
writeSearchStringSQL(query, l.SQLStore, &builder)
writeExcludeSQL(query, &builder)
writeTypeFilterSQL(typeFilter, &builder)
builder.Write(" UNION ")
builder.Write(" ")
builder.Write(l.SQLStore.GetDialect().UnionDistinct())
builder.Write(" ")
}
builder.Write(selectLibraryElementDTOWithMeta)
builder.Write(", le.folder_uid as folder_uid ")
@@ -544,7 +546,9 @@ func (l *LibraryElementService) getAllLibraryElements(c context.Context, signedI
writeSearchStringSQL(query, l.SQLStore, &countBuilder)
writeExcludeSQL(query, &countBuilder)
writeTypeFilterSQL(typeFilter, &countBuilder)
countBuilder.Write(" UNION ")
countBuilder.Write(" ")
countBuilder.Write(l.SQLStore.GetDialect().UnionDistinct())
countBuilder.Write(" ")
}
countBuilder.Write(selectLibraryElementDTOWithMeta)
countBuilder.Write(getFromLibraryElementDTOWithMeta(l.SQLStore.GetDialect()))