case 'stores':
//todo: parameters(lat, long, radius, open now or open + closed, (pickup, delivery) for future))
let stores = (await pool.query('select * from store')).rows;
//ws.subscribe('store/#'); maybe this doesn't make sense? with the filters at least, hard to be dynamic. would be cool as a store opens, it shoes up
case 'stores'://wait for postgis to land before implementing
//todo: parameters(lat, long, radius, open now or open + closed, (pickup, delivery) for future)), or by province, city, country
//https://postgis.net/docs/ST_DWithin.html vs http://postgis.net/docs/geometry_distance_knn.html
//what are the tradeoffs? I want to use geography I think since I don't want to deal with projections, but are we sure google maps coordinates are correct
//what is the spheroid to use?
let stores = (await pool.query('select distinct on(store.id) store.id, store.name, store_image.URL from store left outer join store_image on store.id = store_image.store')).rows;
//ws.subscribe('store/#'); maybe this doesn't make sense? with the filters at least, hard to be dynamic. would be cool as a store opens, it shows up