def asSQL(self, inPars, sqlPars, queryMeta): if self.silent or not self.inputReceived(inPars, queryMeta): return "" res = list(self.makePhrase( self, self.inputKeys, inPars, sqlPars, self.parent)) sql = base.joinOperatorExpr(self.joiner, res) if self.fixedSQL: sql = base.joinOperatorExpr(self.joiner, [sql, self.fixedSQL]) return sql
def _getSQLWhere(self, inputTable, queryMeta): """returns a where fragment and the appropriate parameters for the query defined by inputTable and queryMeta. """ sqlPars = {} inputPars = dict((p.name, p.value) for p in inputTable.iterParams()) return base.joinOperatorExpr("AND", [cd.asSQL(inputPars, sqlPars, queryMeta) for cd in self.condDescs]), sqlPars
def _emitBinop(self, field, sqlPars): return base.joinOperatorExpr( self.operator, [c.asSQL(field, sqlPars) for c in self.children])
def _emitEnum(self, field, sqlPars): return base.joinOperatorExpr( "OR", (self.__class__([child], "=").asSQL(field, sqlPars) for child in self.children))