commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue/common/src/dbdrivers/sapdb DBdriver.py


From: Jason Cater
Subject: gnue/common/src/dbdrivers/sapdb DBdriver.py
Date: Mon, 23 Sep 2002 16:04:01 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/09/23 16:04:00

Modified files:
        common/src/dbdrivers/sapdb: DBdriver.py 

Log message:
        applied Daniel Dittmar's patch for SAP-DB introspection

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/sapdb/DBdriver.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text

Patches:
Index: gnue/common/src/dbdrivers/sapdb/DBdriver.py
diff -c gnue/common/src/dbdrivers/sapdb/DBdriver.py:1.8 
gnue/common/src/dbdrivers/sapdb/DBdriver.py:1.9
*** gnue/common/src/dbdrivers/sapdb/DBdriver.py:1.8     Mon May  6 12:24:53 2002
--- gnue/common/src/dbdrivers/sapdb/DBdriver.py Mon Sep 23 16:04:00 2002
***************
*** 29,42 ****
  #
  #   Supported attributes (via connections.conf or <database> tag)
  #
! #     host=      This is the SAP-DB host for your connection (required)
  #     dbname=    This is the SAP-DB database to use (required)
  #
  
  #### THIS IS AN UNTESTED DRIVER ####
  ####      Any volunteers?       ####
  
! 
  from string import lower
  import sys
  from gnue.common import GDebug, GDataObjects, GConnections
--- 29,42 ----
  #
  #   Supported attributes (via connections.conf or <database> tag)
  #
! #     host=      This is the SAP-DB host for your connection (optional)
  #     dbname=    This is the SAP-DB database to use (required)
  #
  
  #### THIS IS AN UNTESTED DRIVER ####
  ####      Any volunteers?       ####
  
! import string
  from string import lower
  import sys
  from gnue.common import GDebug, GDataObjects, GConnections
***************
*** 50,56 ****
    raise GConnections.AdapterNotInstalled, \
           _("Driver not installed: sapdbapi for SAP-DB 7.x \n[%s]") % message
  
- 
  class SAP_RecordSet(DBSIG_RecordSet):
    pass
  
--- 50,55 ----
***************
*** 77,83 ****
                     user=connectData['_username'], \
                     password=connectData['_password'], \
                     database=connectData['dbname'], \
!                    host=connectData['host'], \
                     autocommit="off")
      except self._DatabaseError, value:
        raise GDataObjects.LoginError, value
--- 76,82 ----
                     user=connectData['_username'], \
                     password=connectData['_password'], \
                     database=connectData['dbname'], \
!                    host=connectData.get ('host', ''), \
                     autocommit="off")
      except self._DatabaseError, value:
        raise GDataObjects.LoginError, value
***************
*** 105,111 ****
  
      where_user = ""
      if type == None:
!       where_type = ''
      else:
        where_type = "where TYPE='%s'" % string.upper(type)
  
--- 104,110 ----
  
      where_user = ""
      if type == None:
!       where_type = "where TYPE <> 'SYSTEM' and TYPE <> 'SYNONYM' "
      else:
        where_type = "where TYPE='%s'" % string.upper(type)
  
***************
*** 147,154 ****
      statement = \
        "select owner||'.'||tablename||'.'||type, " + \
          "owner||'.'||tablename table_name, " + \
!         "type table_type " + \
!         "from domain.tables where owner='%s'%s" \
                % (name, schema) + \
            "order by tablename "
  
--- 146,154 ----
      statement = \
        "select owner||'.'||tablename||'.'||type, " + \
          "owner||'.'||tablename table_name, " + \
!         "type table_type, " + \
!         "owner, tablename " + \
!         "from domain.tables where tablename='%s'%s" \
                % (name, schema) + \
            "order by tablename "
  
***************
*** 160,166 ****
      list = []
      for rs in cursor.fetchall():
        list.append(GDataObjects.Schema(attrs={'id':string.lower(rs[0]), 
'name':rs[1],
!                          'type':rs[2]},
                           getChildSchema=self.__getFieldSchema))
  
      cursor.close()
--- 160,166 ----
      list = []
      for rs in cursor.fetchall():
        list.append(GDataObjects.Schema(attrs={'id':string.lower(rs[0]), 
'name':rs[1],
!                          'type':rs[2], 'sapdbId': (rs [3], rs [4])},
                           getChildSchema=self.__getFieldSchema))
  
      cursor.close()
***************
*** 179,185 ****
      # TODO: it will always report such as TEXT-like fields.
  
      schema, name, type = string.split(parent.id,'.')
! 
      cursor = self._dataConnection.cursor()
  
  #    if type == 'synonym':
--- 179,185 ----
      # TODO: it will always report such as TEXT-like fields.
  
      schema, name, type = string.split(parent.id,'.')
!     owner, basename = parent.sapdbId
      cursor = self._dataConnection.cursor()
  
  #    if type == 'synonym':
***************
*** 196,204 ****
      statement = \
         "select owner||'.'||tablename||'.'||columnname, " + \
         "columnname, datatype, 'Y', len, dec " + \
!        "from domain.columns" + \
!        "where owner = '%s' and tablename = '%s' " % (schema, name) + \
!        "order by pos"
  
      GDebug.printMesg(5,statement)
  
--- 196,204 ----
      statement = \
         "select owner||'.'||tablename||'.'||columnname, " + \
         "columnname, datatype, 'Y', len, dec " + \
!        "from domain.columns " + \
!        "where owner = '%s' and tablename = '%s' " % (owner, basename) + \
!        'order by "POS"'
  
      GDebug.printMesg(5,statement)
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]