How to use the aquests.dbapi.dbconnect.DBConnect.begin_tran 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 / syndbi.py View on Github external
def execute (self, request):
        DBConnect.begin_tran (self, request)
        sql = self._compile (request)

        if not self.connected:
            self.connect ()
            self.conn.isolation_level = None

        try:
            if self.cur is None:
                self.cur = self.conn.cursor ()
            sql = self._compile (request)
            self.cur.execute (sql, *request.params [1:])
            self.has_result = True
        except:
            self.handle_error ()
        else:
            self.close_case ()
github hansroh / aquests / aquests / dbapi / asynpsycopg2.py View on Github external
def execute (self, request):
		dbconnect.DBConnect.begin_tran (self, request)
		self.out_buffer = self._compile (request)
		if not self.connected and not self.connecting:
			self.connect ()
		else:
			state = self.poll ()
			if state != POLL_OK:
				self.reconnect ()
			else:
				self.create_cursor ()
github hansroh / aquests / aquests / dbapi / syndbi.py View on Github external
def execute (self, request):
        DBConnect.begin_tran (self, request)
        try:
            if not self.connected:
                self.connect ()
            self.prefetch ()
        except:
            self.handle_error ()
        else:
            self.close_case ()
github hansroh / aquests / aquests / dbapi / synsqlite3.py View on Github external
def execute (self, request):
		dbconnect.DBConnect.begin_tran (self, request)
		sql = self._compile (request)

		if not self.connected:
			self.connect ()
			self.conn.isolation_level = None

		try:
			if self.cur is None:
				self.cur = self.conn.cursor ()

			if len (request.params) > 1 or sql [:7].lower () == "select ":
				self.cur.execute (sql, *request.params [1:])
				self.has_result = True
			else:
				self.cur.executescript (sql)
		except: