Example #1
0
	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
Example #2
0
	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
Example #3
0
 def _emitBinop(self, field, sqlPars):
     return base.joinOperatorExpr(
         self.operator, [c.asSQL(field, sqlPars) for c in self.children])
Example #4
0
 def _emitEnum(self, field, sqlPars):
     return base.joinOperatorExpr(
         "OR", (self.__class__([child], "=").asSQL(field, sqlPars)
                for child in self.children))