Closed 64J0 closed 6 months ago
The error you pasted is FS3125
, which is F# error, not SQLProvider error. As far as I know, the main limitation and issue is dotnet/fsharp QueryBuilder, not SQLProvider. I've been trying to get them extend the QueryBuilder in the past, but it seems not to be their target.
If the QueryBuilder would support it, the addition to SQLProvider side could be quite easy:
The type LinkData
would need to carry some kind of "what" operations (and
or or
, and equal, not-equal, greater-than, etc.) as currently it does AND equals only, like this:
~~ (String.Join(" AND ", (List.zip data.ForeignKey data.PrimaryKey) |> List.map(fun (foreignKey,primaryKey) ->
sprintf "%s = %s"
(fieldNotation (if data.RelDirection = RelationshipDirection.Parents then fromAlias else destAlias) foreignKey)
(fieldNotation (if data.RelDirection = RelationshipDirection.Parents then destAlias else fromAlias) primaryKey)
))))
There are 2 workarounds here:
for d in ds do
join e in (!!) es on (d.id = e.id)
join s in (!!) ss on (d.id = s.id)
for g in gs do
where (e.group = g.group || s.group = g.group)
Got it, thanks for the fast reply.
I'll move on with some of the workarounds then.
From this example I understood that it works like an
and
:Does it support the
or
too? For example, to translate this query:Originally posted by @64J0 in https://github.com/fsprojects/SQLProvider/issues/141#issuecomment-2117967478
I tested with this code, but it didn't work:
The error is: