You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Robert Peele edited this page Mar 6, 2017
·
1 revision
Custom ordering parameters
One of the things Rezoom.SQL currently does not let you do is
dynamically order your queries. For example, if you want to have a
page that shows the top 50 players in a game, with controls to sort by
frags, damage, or heals, there's no good way to do that.
In short, the problem is that the order by part of a query is not
parameterizable. It should be.
The syntax order by @x already means "order by the constant value of
the parameter @x", which while not very useful, is valid. So we need
new syntax, such as order dynamically @x.
If a query uses this syntax, x should be a parameter to the
generated SQLQueryType.Command(...) method. Its type should be
string * bool, and the string should be checked at runtime against a
whitelist of column names that would be valid for the select
statement. The boolean will mean whether it's ascending (false) or
descending (true).
Furthermore, the column names in the whitelist should be available as
constants in the generated type, like SQLQueryType.X.UserName = "UserName".