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