New initialization, help.

This commit is contained in:
adustman
2001-06-13 00:15:37 +00:00
parent 8a123d5526
commit c0324ddcd3
4 changed files with 82 additions and 1 deletions

View File

@@ -1 +1 @@
ZMySQLDA 2.0.7b2
ZMySQLDA 2.0.8a1

View File

@@ -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')

View File

@@ -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

View File

@@ -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)."""