Sql query creator and executor for javascripts