Live data from Hacker News

SQLAlchemy 0.9.0 Released

sqlalchemy.org

41–43 of 43 posts

Re: SQLAlchemy 0.9.0 Released

#41
post #4

a really solid, perhaps unique, library that, as far as i can tell, completely addresses the "impedence mismatch" argument. if you're directly using a database api in a structured way, you've probably already reimplemented the sqlalchemy core, and refactoring your program to use sqlalchemy will give you an orm, should you want one, and make your code portable across database implementations even if you don't. if you'…

This might be a "LMGTFY" type question, but having never used SQLAlchemy, what sets is apart from something like Hibernate?

It's very similar to a "Hibernate for Python", and I believe it started out that way. However, it has since surpassed Hibernate in capabilities, and presents elegant APIs that cover a more substantial fraction of "things you'd want to do in SQL".

Re: SQLAlchemy 0.9.0 Released

#42

I dunno. I just don't get ORMs. I certainly see their use case in easy prototyping, but with the advent of NoSQL, why not just prototype with MongoDB, or similar, and if it turns out your data is close to uniform in structure, just switch over to MySQL, or similar. To keep my code portable, I stick to standard SQL and don't use any stored procedures. I'm sure this is probably not a tenable strategy for web-scale apps…

Here are 3 primary advantages I can think of:

* Ability to programmatically add to/chain queries. It's really simple to add an additional "WHERE" clause in an ORM query; it's much harder to do so with a SQL string, where you have to account for escaping, comma placement, etc.

* Ability to automatically join entities in some cases, which can save on verbosity.

* Ability to add methods and attributes to models, which can abstract away additional queries or queries that might normally be really complex.

It's debatable if ORMs really add that much to productivity. I use them in some projects, and forgo them in others. For Python, I'm a big fan of Pony ORM because it can greatly reduce verbosity and basically maps Python code directly to SQL; I don't really use it for the relational "mapping" though: http://ponyorm.com/

Re: SQLAlchemy 0.9.0 Released

#43
post #4

a really solid, perhaps unique, library that, as far as i can tell, completely addresses the "impedence mismatch" argument. if you're directly using a database api in a structured way, you've probably already reimplemented the sqlalchemy core, and refactoring your program to use sqlalchemy will give you an orm, should you want one, and make your code portable across database implementations even if you don't. if you'…

MyBatis (formerly iBatis) might be a good option. It's been years since I used it but it's a lightweight alternative to Hibernate: http://blog.mybatis.org/
Post reply on HN