Skip to content

Commit

Permalink
Fix missing binary types for MySQL and MariaDB connector libraries.
Browse files Browse the repository at this point in the history
Fixes #2729
  • Loading branch information
coleifer committed May 22, 2023
1 parent 1f4c86a commit 79b6ebe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions playhouse/mysql_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def cursor(self, commit=None, named_cursor=None):
raise InterfaceError('Error, database connection not opened.')
return self._state.conn.cursor(buffered=True)

def get_binary_type(self):
return mysql_connector.Binary


class MariaDBConnectorDatabase(MySQLDatabase):
def _connect(self):
Expand Down Expand Up @@ -75,6 +78,9 @@ def last_insert_id(self, cursor, query_type=None):
return cursor.lastrowid
return cursor

def get_binary_type(self):
return mariadb.Binary


class JSONField(TextField):
field_type = 'JSON'
Expand Down

0 comments on commit 79b6ebe

Please sign in to comment.