共用方式為


Type.TableKeys

語法

Type.TableKeys(tableType as type) as list

關於

針對所指定資料表類型傳回可能空白的索引鍵清單。

每個索引鍵是以下列形式的記錄來描述:

  • Columns:定義索引鍵的資料行名稱清單
  • Primary:如果索引鍵是資料表的主索引鍵,則為 true,否則為 false

範例 1

傳回資料表類型的索引鍵資訊。

使用方式

let
    BaseType = type table [ID = number, Name = text],
    AddKey = Type.AddTableKey(BaseType, {"ID"}, true),
    DetailsOfKeys = Type.TableKeys(AddKey)
in
    DetailsOfKeys

輸出

{[Columns = {"ID"}, Primary = true]}