Products.ZMySQLDA.DA.Connection¶
The ZODB-based MySQL Database Connection object
-
class
Products.ZMySQLDA.DA.Connection(id, title, connection_string, check, use_unicode=None, auto_create_db=None)[source]¶ Bases:
Shared.DC.ZRDB.Connection.ConnectionZope database adapter for MySQL/MariaDB
-
__init__(id, title, connection_string, check, use_unicode=None, auto_create_db=None)[source]¶ Instance setup. Optionally opens the connection.
String: id – The id of the ZMySQLDA Connection String: title – The title of the ZMySQLDA Connection String: connection_string – The connection string describes how to connect to the relational database. See the documentation for details. Bool: check – Check if the database connection can be opened after instantiation. Bool: use_unicode – If set to True, values from columns of typeCHAR,VARCHARandTEXTare returned as unicode strings by the database backend. Combined with the hardcodedUTF-8character set of this package the setting allows you to control the character set of database return values better. Default: False.Bool: auto_create_db – If the database given in connection_stringdoes not exist, create it automatically. Default: False.
-
connect(conn_string)[source]¶ Base API. Opens connection to mysql. Raises if problems.
String: conn_string – The database connection string
-
manage_edit(title, connection_string, check=None, use_unicode=None, auto_create_db=None)[source]¶ Edit the connection attributes through the Zope ZMI.
String: title – The title of the ZMySQLDA Connection String: connection_string – The connection string describes how to connect to the relational database. See the documentation for details. Bool: check – Check if the database connection can be opened after instantiation. Default: False. Bool: use_unicode – Use unicode internally. Default: False. Bool: auto_create_db – If the database given in connection_stringdoes not exist, create it automatically. Default: False.
-
-
Products.ZMySQLDA.DA.manage_addZMySQLConnection(self, id, title, connection_string, check=None, use_unicode=None, auto_create_db=None, REQUEST=None)[source]¶ Factory function to add a connection object from the Zope ZMI.
String: id – The id of the ZMySQLDA Connection String: title – The title of the ZMySQLDA Connection String: connection_string – The connection string describes how to connect to the relational database. See the documentation for details. Bool: check – Check if the database connection can be opened after instantiation. Default: False. Bool: use_unicode – If set to True, values from columns of typeCHAR,VARCHARandTEXTare returned as unicode strings by the database backend. Combined with the hardcodedUTF-8character set of this package the setting allows you to control the character set of database return values better. Default: False.Bool: auto_create_db – If the database given in connection_stringdoes not exist, create it automatically. Default: False.Object: REQUEST – The currently active Zope request object. Default: None.