-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Description
I tried to execute left join queries both on Oracle and MS SQL Server databases but they result in exception.
Repro steps
I first tried Oracle, then MS SQL Server, here what I did:
- Assuming I have tables SnapshotStore and EventJournal, both having column PersistenceId.
query { for s in db.Dbo.SnapshotStore do
leftOuterJoin e in db.Dbo.EventJournal on (s.PersistenceId = e.PersistenceId) into result
for r in result.DefaultIfEmpty() do
select (s.PersistenceId, r.PersistenceId) }
|> Seq.head
This query resulted in the following exception:
System.Exception: unrecognised method call value(FSharp.Data.Sql.Runtime.QueryImplementation+SqlQueryable1[FSharp.Data.Sql.Common.SqlEntity]).GroupJoin(value(FSharp.Data.Sql.Runtime.QueryImplementation+SqlQueryable
1[FSharp.Data.Sql.Common.SqlEntity]), s => s.GetColumn("PersistenceID"), e => e.GetColumn("PersistenceID"), (s, result) => new AnonymousObject2(Item1 = s, Item2 = result.DefaultIfEmpty())) at Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.EvaluateQuotation(FSharpExpr e) at Microsoft.FSharp.Linq.QueryModule.EvalNonNestedInner(CanEliminate canElim, FSharpExpr queryProducingSequence) at Microsoft.FSharp.Linq.QueryModule.EvalNonNestedOuter(CanEliminate canElim, FSharpExpr tm) at Microsoft.FSharp.Linq.QueryModule.clo@1727-1.Microsoft-FSharp-Linq-ForwardDeclarations-IQueryMethods-Execute[a,b](FSharpExpr
1 q)
at <StartupCode$FSI_0005>.$FSI_0005.main@()
Then I tried different syntax, using (!!) operator like it is shown in examples:
query { for s in db.Dbo.SnapshotStore do
for e in (!!) s.main.EventJournal by PersistenceId
do
for r in result.DefaultIfEmpty() do
select (s.PersistenceId, r.PersistenceId) }
|> Seq.head
But this doesn't compile, the error "main.EventJournal by PersistenceId is not defined". I tried different variations here but the expression inside backticks is not recognized.
This is strange because there are some examples using both syntax conventions and a unit test, but I am not able to make outer join working at all.
Related information
.NET FX 4.61
SQLProvider 1.1.42