What are the standard selects performed on OData services? RRS feed

  • Question

  • Hi all;

    I know this is a difficult question. And it really is an opinion. But please give me your best guess.

    We are creating a wizard to make it easy to create the uri for a select. One of the tricks in this is have the wizard limited to what is needed 90% of the time as that tends to drastically simplify the UI. For example, for SQL we limit it to:

    select column [, column] from table [, table] where column op literal [, and/or column op literal] order by column [, column]

    That is a small subset of what SQL can do, but it covers 98% of what is needed in for report. (Note, we handle the joins automatically.)

    What is it for OData selects? I'm thinking it's pretty much $select, $filter, & $orderby.

    ??? - thanks - dave

    Who will win The International Collegiate Programming Championships?

    Tuesday, August 28, 2012 11:46 PM


  • Hi,

    That depends (but you didn't want to hear that, right? :-))...

    $filter definitely - although you might want to look at all the possible filter expressions and limit those as well (the expression language there is pretty expressive and thus might cause you lot of work).

    $orderby also - but in here I think it would be safe to limit yourself to sorting by simple properties. In theory OData supports expressions in the orderby, but some services don't implement it and we don't encourage people doing it.

    $select probably - this depends on what you do with the data, but it shouldn't be that hard to support (on the client, server is a different story).

    $top and $skip - skip is probably not that useful. top might be useful and should be very easy to implement.

    $expand - given that this is the only way to do real joins (where you get data from both sides), I assume you will need to support it. Supporting it also complicates $select a bit, since now it applies to all the expanded entities as well.

    Navigations (for example ~/Customer(0)/Category) - This one is tricky - there are situations where it's super useful, but providing a good designer for it is probably a lot of work.


    Vitek Karas [MSFT]

    • Marked as answer by DavidThielen Wednesday, August 29, 2012 5:16 PM
    Wednesday, August 29, 2012 7:18 AM