At 03:21 PM 3/30/2006 +1200, Greg Ewing wrote: >Fred L. Drake, Jr. wrote: > > On Wednesday 29 March 2006 21:55, Greg Ewing wrote: > > > import db where db.stdlib == True and db.language == "SQL" \ > > > and db.interface == "DBAPI2.0" > > > > While we're at it, we could spell import "select". :-) > >Getting off on a tangent here, but I would actually >like some decent way of writing SQL queries in Python -- >not for importing, but for database access. Listcomps and generator expressions are effectively equivalent to the nested domain relational calculus -- which is actually more powerful than SQL (which is based more or less on the tuple relational calculus). I've been putting off writing a genexp-to-SQL translator for some time now, but I think somebody else wrote one that actually works; I don't remember if it's SQLAlchemy or one of the other new Python ORM programs. I think it only does the subset of genexps that are easily translated to SQL, but it's certainly a start.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4