Created
February 20, 2019 10:39
-
-
Save rupython/6888738779a0c500315e65fce558b229 to your computer and use it in GitHub Desktop.
From: Nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
вот мой пример | |
def execute(self, sql, args=None, commit=False): | |
conn = self.pool.get_connection() | |
cursor = conn.cursor(dictionary=True)#,buffered=True) | |
if args: | |
cursor.execute(sql, args) | |
else: | |
cursor.execute(sql) | |
if commit is True: | |
conn.commit() | |
self.close(conn, cursor) | |
return None | |
else: | |
res = cursor.fetchall() | |
self.close(conn, cursor) | |
return res |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment