[Glass] We have queries ... do we also get sorts and limits, offset ?

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Thu May 26 06:59:21 PDT 2016


Marten,

So you are proposing extensions to the query language? ... Do you expect 
your end users to be writing these queries?

There is a Smalltalk API for creating queries where you can define 
predicates programmatically. When you do this you have a lot more 
freedom in creating queries. For example, I've added a block predicate 
where you can include a Smalltalk block as part of GsQuery expression 
--- I haven't defined a query syntax for including a smalltalk block, 
but the programmatically it is very useful in some cases ...

Dale


On 5/26/16 3:48 AM, Marten Feldtmann wrote:
>
> Ok,
>
> first I'm not talking about how to use avalable indices or stuff like 
> this - and perhaps OQL (ODMG 3.0) is a little bit overkill.
>
> I would like to see something like:
>
>
> SELECT OBJECT
>
> [ SET  variable = value, .... ]
>
> WHERE <old GsQuery string >
>
> ORDERBY <path> <asc | desc>
>
> LIMIT <number>
>
> OFFSET <number>
>
> Some points:
>
>   * GsQuery should work on UnOrderedCollection and OrderedCollections
>   * If ORDERBY is missing, the order of the original data collection
>     should be used
>   * All values defined in the SET part may be used in the original
>     GsQuery statement (e.g. to make special values available like
>     "Date today")
>   * LIMIT limits the number of returned items
>   * OFFSET starts returning items at index <number>
>   * SELECT OBJECT means, that the "each" object is returned, otherwise
>     this can be enhanced e.g. (select each.id as 'id', each.address.id
>     as 'addressid') and it returns Collections of dictionaries (direct
>     feedable to JSON)
>   * ORDERBY - this can be enhanced by  several sort specification (but
>     one is ok for now)
>   * reuse of queries would be nice, but difficult ?
>
>
> Marten
>
>> Dale Henrichs via Glass <glass at lists.gemtalksystems.com> hat am 24. 
>> Mai 2016 um 19:24 geschrieben:
>>
>> Marten,
>>
>> I think your direction makes a lot of sense :)
>>
>> Could you put together a more detailed proposal in the form of 
>> suggested method selectors and descriptions. I could then use that as 
>> an implementation spec ... perhaps others will have additional 
>> suggestions as well and I could kill several birds with one stone ...
>>
>> Dale
>>
>> On 05/24/2016 01:27 AM, Marten Feldtmann via Glass wrote:
>>>
>>> We have already GsQuery (for filtering) - can we get also stuff (or 
>>> extensions of GsQuery) like:
>>>
>>>   * sort by attribute and direction of sorting: ascending, descending
>>>   * from the result copy a fraction of data: offset and limit
>>>
>>>
>>> ... you see my direction :-)
>>>
>>> Marten
>>>
>>>
>>>
>>> _______________________________________________
>>> Glass mailing list
>>> Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
>>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com
>> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20160526/fdd84a60/attachment-0001.html>


More information about the Glass mailing list