How to use the aquests.dbapi.dbconnect.SQLError function in aquests

To help you get started, we’ve selected a few aquests examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hansroh / aquests / aquests / dbapi / asynpsycopg2.py View on Github external
def _compile (self, request):
		sql = request.params [0]
		if isinstance (sql, (list, tuple)):
			sql = ";\n".join (map (str, sql)) + ";"
		try:
			sql = sql.strip ()
		except AttributeError:
			raise dbconnect.SQLError ("Invalid SQL")
		if not sql:
			raise dbconnect.SQLError ("Empty SQL")
		return sql
github hansroh / aquests / aquests / dbapi / asynpsycopg2.py View on Github external
def _compile (self, request):
		sql = request.params [0]
		if isinstance (sql, (list, tuple)):
			sql = ";\n".join (map (str, sql)) + ";"
		try:
			sql = sql.strip ()
		except AttributeError:
			raise dbconnect.SQLError ("Invalid SQL")
		if not sql:
			raise dbconnect.SQLError ("Empty SQL")
		return sql