Sequelize query function validation