Revision 2276
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_gen.py | ||
---|---|---|
1 | 1 |
# SQL code generation |
2 | 2 |
|
3 |
import operator |
|
4 |
|
|
3 | 5 |
import sql |
4 | 6 |
import strings |
5 | 7 |
import util |
... | ... | |
162 | 164 |
|
163 | 165 |
# Create join condition |
164 | 166 |
type_ = self.type_ |
167 |
joins = self.mapping |
|
165 | 168 |
if type_ is not filter_out and reduce(operator.and_, |
166 | 169 |
(v is join_using for v in joins.itervalues())): |
167 | 170 |
# all cols w/ USING, so can use simpler USING syntax |
... | ... | |
172 | 175 |
if type_ is filter_out: type_ = 'LEFT' |
173 | 176 |
str_ = '' |
174 | 177 |
if type_ != None: str_ += type_+' ' |
175 |
str_ += 'JOIN '+table+' '+join_cond
|
|
178 |
str_ += 'JOIN '+self.table.to_str(db)+' '+join_cond
|
|
176 | 179 |
return str_ |
177 | 180 |
|
178 | 181 |
##### Old-style format support |
Also available in: Unified diff
sql_gen.py: Join.to_str(): Fixed bugs revealed in first test of function