PySide6.QtSql.QSqlIndex¶
- class QSqlIndex¶
QSqlIndex类提供了操作和描述数据库索引的函数。更多…概要¶
属性¶
方法¶
def
__init__()def
append()def
cursorName()def
isDescending()def
name()def
setCursorName()def
setDescending()def
setName()def
swap()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
一个索引指的是数据库中的一个表或视图。关于组成索引的字段的信息可以用来生成SQL语句。
注意
当使用
from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。- property cursorNameᅟ: str¶
此属性保存与索引关联的光标的名称。
- Access functions:
- property nameᅟ: str¶
此属性保存索引的名称。
构造
other的副本。- __init__([cursorName=""[, name=""]])
- Parameters:
cursorName – str
name – str
使用游标名称
cursorname和索引名称name构造一个空索引。这是一个重载函数。
将字段
field添加到索引字段列表中。除非desc为 true,否则字段将以升序排序方式添加。- cursorName()¶
- Return type:
字符串
返回光标名称。
另请参阅
属性
cursorNameᅟ的获取器。- isDescending(i)¶
- Parameters:
i – 整数
- Return type:
布尔
如果索引中的字段
i是按降序排序的,则返回true;否则返回false。- name()¶
- Return type:
字符串
返回名称。
另请参阅
获取属性
nameᅟ的Getter。- setCursorName(cursorName)¶
- Parameters:
cursorName – str
将
cursorName设置为cursorName。另请参阅
属性
cursorNameᅟ的设置器。- setDescending(i, desc)¶
- Parameters:
i – 整数
desc – 布尔值
如果
desc为真,字段i将按降序排序。否则,字段i将按升序排序(默认)。如果字段不存在,则不会发生任何变化。另请参阅
- setName(name)¶
- Parameters:
name – str
将
name设置为name。另请参阅
属性
nameᅟ的设置器。