Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91055
| References | <87zj4xoxfd.fsf@Equus.decebal.nl> <mjn804$4pe$1@dont-email.me> <87siaopxjs.fsf@Equus.decebal.nl> <201505221357.t4MDvgIV001904@fido.openend.se> <87k2w0le41.fsf@nautilus.nautilus> |
|---|---|
| Date | 2015-05-23 03:37 +1000 |
| Subject | Re: Camelot a good tool for me |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.229.1432316225.17265.python-list@python.org> (permalink) |
On Sat, May 23, 2015 at 3:24 AM, Lele Gaifax <lele@metapensiero.it> wrote: > Laura Creighton <lac@openend.se> writes: > >> In my corner of the world, everybody uses SQL. >> [...] >> The people who have tried SQLAlchemy really didn't like it, and of course >> the people who haven't tried it do what their friends do, as usual. > > If these sentences are related, you must live in a very strange corner! > > ;-) Not sure why. I'm in the same corner, I think - I use SQL, and not SQLAlchemy if I can help it. I'd much rather just use psycopg2 and do my own queries. SQLAlchemy has its uses, and it does solve a number of issues in reasonably clean ways, but I don't like a few of its facets, including its peculiar way of doing foreign key relationships. (You put a foreign key in the child, and you put a relationship in the parent, which feels backwards.) There's a lot of magic going on. When magic works, it's great; but when anything goes wrong, it's harder to see what happened. (Also, when does a transaction begin and end? If you session.commit() in the middle of iterating over a query, will it break the query? What if you roll back? Can you see, instantly, in your code?) Even if the ORM layer is practically perfect in every way, there's still value in learning SQL; for instance, if you drop to a command-line interpreter like PostgreSQL's psql, or if you switch to another language, or anything like that, it's helpful to know what's going on under the covers. And if you have to know SQL anyway, the advantage of the abstraction layer has to justify the cost of learning an additional, not a replacement, API. So, while SQLAlchemy is definitely a lot better than most I've seen, it's still not really good enough for me to use everywhere. I'm mostly going to stick to the Python DB API 2.0. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Camelot a good tool for me Cecil Westerhof <Cecil@decebal.nl> - 2015-05-22 09:59 +0200
Re: Camelot a good tool for me Dan Sommers <dan@tombstonezero.net> - 2015-05-22 12:38 +0000
Re: Camelot a good tool for me Ben Finney <ben+python@benfinney.id.au> - 2015-05-22 23:02 +1000
Re: Camelot a good tool for me Cecil Westerhof <Cecil@decebal.nl> - 2015-05-22 15:11 +0200
Re: Camelot a good tool for me Tim Golden <mail@timgolden.me.uk> - 2015-05-22 14:29 +0100
Re: Camelot a good tool for me Laura Creighton <lac@openend.se> - 2015-05-22 15:57 +0200
Re: Camelot a good tool for me Lele Gaifax <lele@metapensiero.it> - 2015-05-22 19:24 +0200
Re: Camelot a good tool for me Chris Angelico <rosuav@gmail.com> - 2015-05-23 03:37 +1000
Re: Camelot a good tool for me Laura Creighton <lac@openend.se> - 2015-05-22 19:56 +0200
Re: Camelot a good tool for me Lele Gaifax <lele@metapensiero.it> - 2015-05-22 21:12 +0200
Re: Camelot a good tool for me Chris Angelico <rosuav@gmail.com> - 2015-05-23 18:59 +1000
Re: Camelot a good tool for me Lele Gaifax <lele@metapensiero.it> - 2015-05-24 15:15 +0200
Re: Camelot a good tool for me Laura Creighton <lac@openend.se> - 2015-05-22 15:03 +0200
Re: Camelot a good tool for me OT beauty of Tk Christian Gollwitzer <auriocus@gmx.de> - 2015-05-22 21:52 +0200
Re: Camelot a good tool for me OT beauty of Tk Laura Creighton <lac@openend.se> - 2015-05-22 22:13 +0200
Re: Camelot a good tool for me Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-05-22 15:24 +0100
Re: Camelot a good tool for me felix <felix@epepm.cupet.cu> - 2015-05-22 10:50 -0400
Re: Camelot a good tool for me Tim Chase <python.list@tim.thechases.com> - 2015-05-24 07:05 -0500
csiph-web