News for hackers. Stuff that matters.
Re:SpahQL - A query language for Javascript objects by pygy_ on Monday May 21, 2012 @04:55AM (#4001955)
Interresting.

SQlike is another effort in the same direction. It provides a wide range of SQL features including joins. JavaScript tables are used as query language.

See http://www.thomasfrank.se/sqlike.html for an overview and http://www.thomasfrank.se/SQLike/ for examples.

    dataArray = [
    {firstName: "Paul", lastName: "Stele", age:35, salary:35000},
    ...
    ]

    dataArray2 = [
    {firstName: "Paul", lastName: "Stele", favColor:"green"},
    ...
    ]

    SQLike.q(
       {
           Select: ['*'],
           From: dataArray,
           Where: function(){return this.salary>50000},
           OrderBy: ['salary','|desc|']
       }
    )


    SQLike.q(
       {
           Select: ['*'],
           From: {t1:dataArray},
           NaturalJoin: {t2:dataArray2},
           Where:function(){return this.t1.firstName!='Vicki'}
       }
    )
Re:SpahQL - A query language for Javascript objects by angryamoeba on Monday May 21, 2012 @05:06AM (#4001968)
This looks pretty handy for large datasets, to be sure.

SpahQL is definitely much lighter than that - the API is intended to be more jquery-like with a specific selector language, each selection returning a resultset object which then provides methods for subselections and modifications.