/[gnue]/gnue-common/src/datasources/drivers/sqlite/Schema/Discovery/Introspection.py
ViewVC logotype

Diff of /gnue-common/src/datasources/drivers/sqlite/Schema/Discovery/Introspection.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by jcater, Fri Oct 10 01:21:32 2003 UTC revision 1.1.2.2 by jcater, Wed Nov 19 03:00:25 2003 UTC
# Line 72  class Introspection(GIntrospection.Intro Line 72  class Introspection(GIntrospection.Intro
72                  "SELECT type,name,tbl_name,sql FROM temp_master "+\                  "SELECT type,name,tbl_name,sql FROM temp_master "+\
73                  where+" ORDER BY name;"                  where+" ORDER BY name;"
74    
75      cursor = self.native.cursor()      cursor = self._connection.native.cursor()
76      GDebug.printMesg(1,"** Executing: %s **" % statement)      GDebug.printMesg(1,"** Executing: %s **" % statement)
77      cursor.execute(statement)      cursor.execute(statement)
78    
79      list = []      list = []
80      for rs in cursor.fetchall():      for rs in cursor.fetchall():
81        if rs[0] in ('table','view'):        if rs[0] in ('table','view'):
82          list.append(GDataObjects.Schema(attrs={'id':rs[1], 'name':rs[1], \          list.append(GIntrospection.Schema(attrs={'id':rs[1], 'name':rs[1], \
83                                                 'type':rs[0],},                                                 'type':rs[0],},
84                                          getChildSchema=self.__getFieldSchema))                                          getChildSchema=self.__getFieldSchema))
85    
# Line 101  class Introspection(GIntrospection.Intro Line 101  class Introspection(GIntrospection.Intro
101                   "SELECT type,name,tbl_name,sql FROM temp_master "+\                   "SELECT type,name,tbl_name,sql FROM temp_master "+\
102                   "WHERE name='%s' "+where+" ORDER BY name;") % (name,name)                   "WHERE name='%s' "+where+" ORDER BY name;") % (name,name)
103    
104      cursor = self.native.cursor()      cursor = self._connection.native.cursor()
105      GDebug.printMesg(1,"** Executing: %s **" % statement)      GDebug.printMesg(1,"** Executing: %s **" % statement)
106      cursor.execute(statement)      cursor.execute(statement)
107    
108      rs = cursor.fetchone()      rs = cursor.fetchone()
109      if rs and rs[0] in ('table','view'):      if rs and rs[0] in ('table','view'):
110        schema = GDataObjects.Schema(attrs={'id':rs[1], 'name':rs[1], \        schema = GIntrospection.Schema(attrs={'id':rs[1], 'name':rs[1], \
111                                            'type':rs[0],},                                            'type':rs[0],},
112                                     getChildSchema=self.__getFieldSchema)                                     getChildSchema=self.__getFieldSchema)
113      else:      else:
# Line 131  class Introspection(GIntrospection.Intro Line 131  class Introspection(GIntrospection.Intro
131                   "and name='%s' ORDER BY name;") % (parent.type,parent.id,\                   "and name='%s' ORDER BY name;") % (parent.type,parent.id,\
132                                                      parent.type,parent.id)                                                      parent.type,parent.id)
133    
134      cursor = self.native.cursor()      cursor = self._connection.native.cursor()
135      GDebug.printMesg(1,"** Executing: %s **" % statement)      GDebug.printMesg(1,"** Executing: %s **" % statement)
136      cursor.execute(statement)      cursor.execute(statement)
137      columns = cursor.description      columns = cursor.description
# Line 184  class Introspection(GIntrospection.Intro Line 184  class Introspection(GIntrospection.Intro
184          else:          else:
185            attrs['datatype']='text'            attrs['datatype']='text'
186    
187          list.append(GDataObjects.Schema(attrs=attrs))          list.append(GIntrospection.Schema(attrs=attrs))
188    
189      return list      return list
190    

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26