sequelize icon indicating copy to clipboard operation
sequelize copied to clipboard

Refactor: Remove dottie.transform from raw queries

Open mickhansen opened this issue 12 years ago • 9 comments

Currently we transform raw queries so they become nested objects. Imo we shouldn't do this, if the user asks for raw, let's give provide raw.

mickhansen avatar May 30 '14 07:05 mickhansen

This would be helpful to retain as an option. We often use raw to get a more quickly generated object that skips all the DAO overhead but retains basic object nesting.

seth-admittedly avatar May 30 '14 13:05 seth-admittedly

@seth-admittedly hmm i didn't think anyone actually used this. I suppose we could hide it behind a flag.

mickhansen avatar May 30 '14 14:05 mickhansen

This is the feature where if I do

orm.User.find({where : {name : "Seth"}, include : [orm.Dog]}, {raw : true})

I'll get an object back in success

{name : "Seth", dog : {name : "Fido"}}

right?

seth-admittedly avatar May 30 '14 15:05 seth-admittedly

Yea that's right.

mickhansen avatar May 30 '14 15:05 mickhansen

Yep, we definitely use that for some of our data work where we just need a simple included model without the DAO.

seth-admittedly avatar May 30 '14 15:05 seth-admittedly

@seth-admittedly alright, i'll keep that in mind.

mickhansen avatar May 30 '14 16:05 mickhansen

@seth-admittedly https://github.com/sequelize/sequelize/pull/2064 dottie.transform now needs nest: true to work, from next 2.0.0 release/master

mickhansen avatar Jul 21 '14 07:07 mickhansen

Excellent, will make sure to add the flag on the next upgrade

seth-admittedly avatar Jul 21 '14 13:07 seth-admittedly

I'm using this feature, thanks for keeping it as an option!

goodthing avatar Apr 28 '15 04:04 goodthing