Skip to content
Mathias Rangel Wulff edited this page Jun 11, 2015 · 4 revisions

AlaSQL + Meteor

AlaSQL supports querieng directly on Meteor collections.

Sounds simple - And it is. Walker-Morgan from compose.io puts it this way:

This lets you turn

return Robots.find({}, { sort: { introduced: 1 }} ); 

into

return alasql('SELECT * FROM ? ORDER BY introduced',[Robots]);  

which doesn't look like a huge jump, until you realise that this works in both the browser and the server and opens up a way to do JOIN, GROUP BY, UNION, DISTINCT and others.

Please read his article about Meteor and AlaSQL if you find it interesting.


AlaSQL works on client and the server side. To get started install AlaSQL for Meteor from the Meteor packagemanager aatmospherejs:

    meteor add agershun:alasql

Now you can query directly on Meteor Collections with the alasql function:

    Template.body.helpers({
       tasks: function () {
         return alasql('SELECT * WHEERE done = false FROM ?',[Tasks]);
       }
    });
Clone this wiki locally