I really like using sequelize as my ORM for my node application, but right now, I am kind of irritated when they are passing DAO objects by default when you query. How can I set the raw option to true all the time?
According to the doc :
If you do not provide other arguments than the SQL, raw will be assumed to the true, and sequelize will not try to do any formatting to the results of the query.
That being said :
The Sequelize object has a [options.query={}] optional parameter to set default options for sequelize.query. Source
You should be able to use :
var sequelize = new Sequelize('database', 'username', 'password', {query:{raw:true}})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With