[OPEN-ILS-DEV] Default SELECT lists in JSON queries

Scott McKellar mck9 at swbell.net
Mon Aug 10 13:02:49 EDT 2009


SON queries let you ask for a default SELECT list, sort of like SELECT *,
for the core class.  There are two valid (and equivalent) ways to do this:

{
        "select" : { "aou" : "*" },
        "from"  : "aou"
}

{
        "select" : { "aou" : null },
        "from"  : "aou"
}

Until recently there were also several invalid ways to get the same
result.  They worked only by accident.  Now they don't.  With one
exception as noted below, they are now errors.

(I am referring to trunk.  Presumably Mike is not going to backport this
change to 1.6 or previous versions.)

Most of these invalid constructs were probably never used, because they
are neither sensible nor intuitively appealing.  However the exception
might have been used somewhere, namely an empty array:

{
        "select" : { "aou": [] },
        "from"  : "aou"
}

In particular, this usage is currently sanctioned by the documentation for
JSON queries.  I will change the documentation, but I haven't yet.

Henceforth, an empty array in this context means "don't give me any fields
from this class."  It results in a warning message but not an error,
unless of course it causes the SELECT clause to be completely empty.

If you've ever used anything but the officially approved methods for
requesting a default SELECT list, you'll need to revisit that code
eventually.

Scott McKellar


More information about the Open-ils-dev mailing list