Closed toburger closed 8 years ago
It seems skip isn't not implemented on any of the providers. This should be an easy enough fix I'm hoping to get to this at the weekend.
I didn't do this originally for sql server, it is easy to do in 2012 but you have to mess around a bit in earlier versions using row number. Completely forgot about it until now :) It should be throwing there really ..
Yes, I think it is advisable to throw an exception, if a query feature isn't implemented.
There are some other operators missing from the F# Query Expressions API as well: https://msdn.microsoft.com/en-us/library/hh225374.aspx
E.g. headOrDefault is not working, but head will return the result that I would expect as headOrDefault (in the NuGet version). That is ok, I don't mind, it would just be nice to support the whole API.
The whole query expression API is big and we have several large, complicated bits missing, such as nested queries and aggregation (and indeed left join outside my !! operator requires group join to be implemented) - these are big projects. Certainly more operators like headOrDefault are fairly simple to implement, we have a bunch of them already.
The original non-erasing sql provider is simply a wrapper around sqlmetal so you get the whole linq expression tree for free :)
It is also worth noting that in some cases, the examples there generate different sql to what we do, sometimes better and sometimes worse.
Edit: in hindsight I should not have used query { }
as the LINQ trees are crazy and hard to deal with.
Ross
FYI https://github.com/colinbull/SqlProvider/blob/feat_nicer_naming/tests/SqlProvider.Tests/QueryTests.fs this shows what is currently supported an not.
@pezipink This looks like it might be fixed? Is this the case?
I fixed it in the V1 branch for sql server 2012 and up... mysql and postgres it was already working for I think.
Earlier versions of sql server this is a bit of a pain and hacky to achieve.
I lied, postgres is not implemented. MySql is though, and they both use LIMIT
.. maybe postgres can use the same implementation? https://github.com/fsprojects/SQLProvider/blob/master/src/SQLProvider/Providers.MySql.fs#L531
I think I can close this now. As it look as if we have as much support is as possible across all the providers. ODBC is the only one I'm not sure about.
I don't have tested the other providers, but MSSQLSERVER and MSACCESS seem to ignore the Skip command.