replace db.all() for db.gql(SELECT ...)