diff --git a/ZMySQLDA/lib/python/Products/ZMySQLDA/VERSION.txt b/ZMySQLDA/lib/python/Products/ZMySQLDA/VERSION.txt index e5e98d3..caf18db 100644 --- a/ZMySQLDA/lib/python/Products/ZMySQLDA/VERSION.txt +++ b/ZMySQLDA/lib/python/Products/ZMySQLDA/VERSION.txt @@ -1 +1 @@ -ZMySQLDA 2.0.7b2 +ZMySQLDA 2.0.8a1 diff --git a/ZMySQLDA/lib/python/Products/ZMySQLDA/__init__.py b/ZMySQLDA/lib/python/Products/ZMySQLDA/__init__.py index 764c425..e1dcd91 100644 --- a/ZMySQLDA/lib/python/Products/ZMySQLDA/__init__.py +++ b/ZMySQLDA/lib/python/Products/ZMySQLDA/__init__.py @@ -95,3 +95,16 @@ meta_types=DA.meta_types methods=DA.folder_methods misc_=DA.misc_ __ac_permissions__=DA.__ac_permissions__ + +def initialize(context): + + context.registerClass( + DA.Connection, + permission='Add Z MySQL Database Connections', + constructors=(DA.manage_addZMySQLConnectionForm,), + icon='misc_/ZMySQLDA/conn', + ) + + context.registerHelp() + context.registerHelpTitle('ZMySQLDA') + diff --git a/ZMySQLDA/lib/python/Products/ZMySQLDA/help/DA.py b/ZMySQLDA/lib/python/Products/ZMySQLDA/help/DA.py new file mode 100644 index 0000000..460a6f0 --- /dev/null +++ b/ZMySQLDA/lib/python/Products/ZMySQLDA/help/DA.py @@ -0,0 +1,40 @@ +def manage_addZMySQLConnection(self, id, title, + connection_string, + check=None, REQUEST=None): + """Add a MySQL connection to a folder. + + Arguments: + + REQUEST -- The current request + + title -- The title of the ZMySQLDA Connection (string) + + id -- The id of the ZMySQLDA Connection (string) + + connection_string -- The connection string is of the form: + + '[+/-]database[@host[:port]] [user [password [unix_socket]]]' + + or typically: + + 'database user password' + + to use a MySQL server on localhost via the standard UNIX socket. + Only specify host if the server is on a remote system. You can + use a non-standard port, if necessary. If the UNIX socket is in + a non-standard location, you can specify the full path to it + after the password. Transactions will be used if the server + supports them. If you are using non-transaction-safe tables, + a '-' at the beginning will disable transactions. If you want to + be sure transactions are used, a '+' at the beginning will + forcibly enable transactions; an exception will be raised if + the server does not support transactions. + + """ + +class Connection: + """MySQL Connection Object""" + + __constructor__ = manage_addZMySQLConnection + + diff --git a/ZMySQLDA/lib/python/Products/ZMySQLDA/help/db.py b/ZMySQLDA/lib/python/Products/ZMySQLDA/help/db.py new file mode 100644 index 0000000..2946fdf --- /dev/null +++ b/ZMySQLDA/lib/python/Products/ZMySQLDA/help/db.py @@ -0,0 +1,28 @@ +class DB: + + """This is the ZMySQLDA Database Connection Object.""" + + def __init__(self,connection): + """ + connection + blah blah + """ + + def tables(self, rdb=0, + _care=('TABLE', 'VIEW')): + """Returns a list of tables in the current database.""" + + def columns(self, table_name): + """Returns a list of column descriptions for 'table_name'.""" + + def query(self,query_string, max_rows=1000): + """Execute 'query_string' and return at most 'max_rows'.""" + + def _begin(self, *ignored): + """Begin a transaction (when TM is enabled).""" + + def _finish(self, *ignored): + """Commit a transaction (when TM is enabled).""" + + def _abort(self, *ignored): + """Rollback a transaction (when TM is enabled)."""