本文整理匯總了Python中db_manager.db_plugins.postgis.connector.PostGisDBConnector._get_cursor_columns方法的典型用法代碼示例。如果您正苦於以下問題:Python PostGisDBConnector._get_cursor_columns方法的具體用法?Python PostGisDBConnector._get_cursor_columns怎麽用?Python PostGisDBConnector._get_cursor_columns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類db_manager.db_plugins.postgis.connector.PostGisDBConnector
的用法示例。
在下文中一共展示了PostGisDBConnector._get_cursor_columns方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sqlExec
# 需要導入模塊: from db_manager.db_plugins.postgis.connector import PostGisDBConnector [as 別名]
# 或者: from db_manager.db_plugins.postgis.connector.PostGisDBConnector import _get_cursor_columns [as 別名]
def sqlExec(self, sql):
# Execute a SQL query and, return [header, data, rowCount]
connector = PostGisDBConnector(self.uri)
#print "DEBUG dbrequest : sql = " + sql
try:
c = connector._execute(None, unicode(sql))
data = []
header = connector._get_cursor_columns(c)
except:
print "Erreur SQL : " + str(sql) # debug purpose
raise
if header is None:
header = []
if len(header) > 0:
data = connector._fetchall(c)
row_count = c.rowcount
if row_count == -1:
row_count = len(data)
if c:
c.close()
del c
connector.__del__()
return [header, data, row_count]