本文整理汇总了Python中psycopg2.extensions.connection.cursor函数的典型用法代码示例。如果您正苦于以下问题:Python cursor函数的具体用法?Python cursor怎么用?Python cursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cursor函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: cursor
def cursor (self, fetchsize = None):
"Return a psycopg2 Cursor object for operating on the connection."
if fetchsize:
# Tell psycopg2 to create a server-side cursor so that it will
# return the results in batches of the indicated size instead of
# retrieving all results on the first fetch.
#name = some unique, valid cursor name
#curs = pgConnection.cursor (self, name)
#curs.itersize = fetchsize
raise NotImplementedError ('Need algorithm for unique cursor name.')
else:
curs = pgConnection.cursor (self)
return curs
开发者ID:DarkEnergySurvey,项目名称:despydb,代码行数:16,代码来源:pgcon.py
示例2: cursor
def cursor(self):
# DictCursor allows for both integer and key based row access
return _2connection.cursor(self, cursor_factory=DictCursor)
开发者ID:akrherz,项目名称:pyIEM,代码行数:3,代码来源:twistedpg.py
示例3: cursor
def cursor(self):
"""cursor() -> new psycopg 1.1.x compatible cursor object"""
return _2connection.cursor(self, cursor_factory=cursor)
开发者ID:CollinsMuiruri,项目名称:Instagram,代码行数:3,代码来源:psycopg1.py
示例4: cursor
def cursor(self, *args, **kwargs):
# type: (*Any, **Any) -> TimeTrackingCursor
kwargs.setdefault('cursor_factory', TimeTrackingCursor)
return connection.cursor(self, *args, **kwargs)
开发者ID:aakash-cr7,项目名称:zulip,代码行数:4,代码来源:db.py
示例5: cursor
def cursor(self, name=None):
if name is None:
return _connection.cursor(self, cursor_factory=DictCursor)
else:
return _connection.cursor(self, name, cursor_factory=DictCursor)
开发者ID:pombredanne,项目名称:Vixen,代码行数:5,代码来源:extras.py
示例6: cursor
def cursor(self):
return _connection.cursor(self, cursor_factory=DictCursor)
开发者ID:almccon,项目名称:DYCAST,代码行数:2,代码来源:extras.py
示例7: cursor
def cursor(self, *args, **kwargs):
kwargs['cursor_factory'] = NamedTupleCursor
return _connection.cursor(self, *args, **kwargs)
开发者ID:ovidiucp,项目名称:psycopg2-ctypes,代码行数:3,代码来源:extras.py
注:本文中的psycopg2.extensions.connection.cursor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论