Giter VIP home page Giter VIP logo

Comments (6)

pezipink avatar pezipink commented on May 18, 2024

I only presently support select, for, join, distinct, where, take, exactlyOne, sortBy, sortByDescending, thenBy, thenByDescending. There are a boat load more keywords not currently supported. (see http://msdn.microsoft.com/en-us/library/hh225374.aspx)

Count is not the same as Seq.length. It has to be formed as part of the various abstract query representations and built intelligently into the SQL query, eg SELECT COUNT(*) FROM Student. This would probably be done if and when I am brave enough to tackle GroupJoin (unless someone feels the urge to do it for me :) )

from sqlprovider.

forki avatar forki commented on May 18, 2024

Yes I know this and tried to implement it. I failed.

I think count is one of the most important operators at this stage since it's good for sanity checks.
It would be awesome if you could add it.
Maybe I can add similar operators by analyzing your commit.

from sqlprovider.

jackfoxy avatar jackfoxy commented on May 18, 2024

I'll take a look. I naively assumed it was a matter of renaming Length to Count.

from sqlprovider.

pezipink avatar pezipink commented on May 18, 2024

Count is an odd one because it fires after the query has been generated but before it has been executed, so looking at how this is implemented once it is done might not be that helpful in working out the others.

In fact, it might require some interesting changes to get this to work. I see your point about it being used as a sanity checking tool. I could try to implement this with a priority if it looks like it's going to take you too long to figure out Jack, please do feel free to have a go though but you are going down the rabbit hole with this one ! :)

from sqlprovider.

pezipink avatar pezipink commented on May 18, 2024

ok this is done now - you were close. Except the count happens after the query has been built (it fires the execute method). The transformed projection tree then needs throwing away to be replaced by an execute scalar call, so the way the query is executed has to change.

Note: for some really crazy reason, if you have a select many followed by just a count like this

for x in y
for z in x
count

the count part simply does not fire. Execute does not get triggered, neither is there any indication count has been used in the expression tree. Perhaps one for fsbugs. Putting a select in there will fix it.

from sqlprovider.

forki avatar forki commented on May 18, 2024

works like a charme. http://forki.github.io/DynamicsNAVProvider/queries.html
Thanks

from sqlprovider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.