开发者

Werkzeug without ORM

How do I use the Werkzeug framework without any ORM like SQLAlchemy? In my case, it's a lot of effort to rewrite all the tables and columns in SQLAlchemy开发者_如何学Go from existing tables & data.

How do I query the database and make an object from the database output?

In my case now, I use Oracle with cx_Oracle. If you have a solution for MySQL, too, please mention it.

Thanks.


SQLAlchemy supports reflection so you don't have to do that. Take a look at the autoload parameter of Table, you can even make this work with the ORM.


Is it a problem to use normal DB API, issue regular SQL queries, etc? cx_Oracle even has connection pooling biolt in to help you manage connections.


maybe this is what i looking for http://www.sqlalchemy.org/trac/wiki/SqlSoup and ht*p://spyced.blogspot.com/2006/04/introducing-sqlsoup.html

so i don't have to declare the table to get the object

rp = db.bind.execute('select * from mupp') a = rp.fetchall() a[0].name

that's great...thanks for all inspiring response

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜