[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/rdb/interfaces.py Removed duplicate and unused interface

Dmitry Vasiliev dima at hlabs.spb.ru
Wed Aug 24 10:17:21 EDT 2005


Log message for revision 38059:
  Removed duplicate and unused interface
  

Changed:
  U   Zope3/trunk/src/zope/app/rdb/interfaces.py

-=-
Modified: Zope3/trunk/src/zope/app/rdb/interfaces.py
===================================================================
--- Zope3/trunk/src/zope/app/rdb/interfaces.py	2005-08-24 14:13:56 UTC (rev 38058)
+++ Zope3/trunk/src/zope/app/rdb/interfaces.py	2005-08-24 14:17:21 UTC (rev 38059)
@@ -20,6 +20,7 @@
 from zope.schema import TextLine
 from zope.app.i18n import ZopeMessageIDFactory as _
 
+
 class IDBITypeInfoProvider(Interface):
     """This object can get the Type Info for a particular DBI
     implementation."""
@@ -27,7 +28,6 @@
     def getTypeInfo():
         """Return an IDBITypeInfo object."""
 
-
 class IDBITypeInfo(Interface):
     """Database adapter specific information"""
 
@@ -74,120 +74,6 @@
     def getConverter(type):
         """Return a converter function for field type matching key"""
 
-
-arraysize = 1 # default constant, symbolic
-
-class ICursor(Interface):
-    """DB API ICursor interface"""
-
-    description = Attribute("""This read-only attribute is a sequence of
-        7-item sequences. Each of these sequences contains information
-        describing one result column: (name, type_code, display_size,
-        internal_size, precision, scale, null_ok). This attribute will be None
-        for operations that do not return rows or if the cursor has not had an
-        operation invoked via the executeZZZ() method yet.
-
-        The type_code can be interpreted by comparing it to the Type Objects
-        specified in the section below. """)
-
-    arraysize = Attribute("""This read/write attribute specifies the number of
-        rows to fetch at a time with fetchmany(). It defaults to 1 meaning to
-        fetch a single row at a time.
-
-        Implementations must observe this value with respect to the
-        fetchmany() method, but are free to interact with the database a
-        single row at a time. It may also be used in the implementation of
-        executemany().
-        """)
-
-    def close():
-        """Close the cursor now (rather than whenever __del__ is called).  The
-        cursor will be unusable from this point forward; an Error (or
-        subclass) exception will be raised if any operation is attempted with
-        the cursor.
-        """
-
-    def execute(operation, parameters=None):
-        """Prepare and execute a database operation (query or
-        command). Parameters may be provided as sequence or mapping and will
-        be bound to variables in the operation. Variables are specified in a
-        database-specific notation (see the module's paramstyle attribute for
-        details). [5]
-
-        A reference to the operation will be retained by the cursor. If the
-        same operation object is passed in again, then the cursor can optimize
-        its behavior. This is most effective for algorithms where the same
-        operation is used, but different parameters are bound to it (many
-        times).
-
-        For maximum efficiency when reusing an operation, it is best to use
-        the setinputsizes() method to specify the parameter types and sizes
-        ahead of time. It is legal for a parameter to not match the predefined
-        information; the implementation should compensate, possibly with a
-        loss of efficiency.
-
-        The parameters may also be specified as list of tuples to e.g. insert
-        multiple rows in a single operation, but this kind of usage is
-        depreciated: executemany() should be used instead.
-
-        Return values are not defined.
-        """
-
-
-    def executemany(operation, seq_of_parameters):
-        """Prepare a database operation (query or command) and then execute it
-        against all parameter sequences or mappings found in the sequence
-        seq_of_parameters.
-
-        Modules are free to implement this method using multiple calls to the
-        execute() method or by using array operations to have the database
-        process the sequence as a whole in one call.
-
-        The same comments as for execute() also apply accordingly to this
-        method.
-
-        Return values are not defined.
-        """
-
-    def fetchone():
-        """Fetch the next row of a query result set, returning a single
-        sequence, or None when no more data is available.
-
-        An Error (or subclass) exception is raised if the previous call to
-        executeZZZ() did not produce any result set or no call was issued yet.
-        """
-
-    def fetchmany(size=arraysize):
-        """Fetch the next set of rows of a query result, returning a sequence
-        of sequences (e.g. a list of tuples). An empty sequence is returned
-        when no more rows are available.
-
-        The number of rows to fetch per call is specified by the parameter. If
-        it is not given, the cursor's arraysize determines the number of rows
-        to be fetched. The method should try to fetch as many rows as
-        indicated by the size parameter. If this is not possible due to the
-        specified number of rows not being available, fewer rows may be
-        returned.
-
-        An Error (or subclass) exception is raised if the previous call to
-        executeZZZ() did not produce any result set or no call was issued yet.
-
-        Note there are performance considerations involved with the size
-        parameter. For optimal performance, it is usually best to use the
-        arraysize attribute. If the size parameter is used, then it is best
-        for it to retain the same value from one fetchmany() call to the next.
-        """
-
-    def fetchall():
-        """Fetch all (remaining) rows of a query result, returning them as a
-        sequence of sequences (e.g. a list of tuples). Note that the cursor's
-        arraysize attribute can affect the performance of this operation.
-
-        An Error (or subclass) exception is raised if the previous call to
-        executeZZZ() did not produce any result set or no call was issued yet.
-        """
-
-
 class IResultSet(Interface):
     """Holds results, and allows iteration."""
 
@@ -207,6 +93,7 @@
     def __str__(self):
         return self.message
 
+arraysize = 1 # default constant, symbolic
 
 class IDBICursor(Interface):
     """DB API ICursor interface"""
@@ -264,7 +151,6 @@
         Return values are not defined.
         """
 
-
     def executemany(operation, seq_of_parameters):
         """Prepare a database operation (query or command) and then execute it
         against all parameter sequences or mappings found in the sequence
@@ -318,12 +204,11 @@
         executeZZZ() did not produce any result set or no call was issued yet.
         """
 
-
 class IDBIConnection(Interface):
     """A DB-API based Interface """
 
     def cursor():
-        """Return a new ICursor Object using the connection.
+        """Return a new IDBICursor Object using the connection.
 
         If the database does not provide a direct cursor concept, the module
         will have to emulate cursors using other means to the extent needed by
@@ -351,7 +236,6 @@
         attempted with the connection. The same applies to all cursor objects
         trying to use the connection.  """
 
-
 class ISQLCommand(Interface):
     """Static SQL commands."""
 
@@ -364,8 +248,6 @@
     def __call__():
         """Execute an sql query and return a result object if appropriate"""
 
-
-
 class IZopeDatabaseAdapter(IDBITypeInfo):
     """Interface for persistent object that returns
     volatile IZopeConnections."""
@@ -413,7 +295,6 @@
     """Database adapters with management functions
     """
 
-
 class IZopeConnection(IDBIConnection, IDBITypeInfoProvider):
 
     # An implementation of this object will be exposed to the
@@ -431,20 +312,19 @@
         manager.
         """
 
-
 class IZopeCursor(IDBICursor):
-    """An ICursor that integrates with Zope's transactions"""
+    """An IDBICursor that integrates with Zope's transactions"""
 
     def execute(operation, parameters=None):
         """Executes an operation, registering the underlying connection with
         the transaction system.
 
-        See ICursor for more detailed execute information.
+        See IDBICursor for more detailed execute information.
         """
 
-    def executemany(operation, seq_of_parameters=None):
+    def executemany(operation, seq_of_parameters):
         """Executes an operation, registering the underlying connection with
         the transaction system.
 
-        See ICursor for more detailed executemany information.
+        See IDBICursor for more detailed executemany information.
         """



More information about the Zope3-Checkins mailing list