dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 376 forks source link

How can I do raw query when using express? #544

Open daimajia opened 10 years ago

daimajia commented 10 years ago

https://github.com/dresende/node-orm2#raw-queries It seems there is only one way... but how to do with express

wildfireXwind commented 10 years ago

like https://github.com/dresende/node-orm2#express, you can make db as models property, such as, models.db = db, then, you can use req.models.db.driver.execQuery(....) to do raw query

yuklai commented 10 years ago

I have a similar question but my goal is trying to find a stop gap of old code that doesn't use orm and new code in the same project that uses orm so that they share the same connection:

http://stackoverflow.com/questions/25465031/sharing-pool-object-between-orm-and-existing-code-that-use-pool-directly

Anyone have ideas?