Table of Contents

Class OdfDatabaseSchema

Namespace
OdfKit.Database
Assembly
OdfKit.dll

Represents the schema definition accessor for an ODB database, used to model table structures, primary keys, and foreign key relationships. 表示 ODB 資料庫的 Schema 定義存取器,用於建模資料表結構、主鍵與外鍵關聯。

public sealed class OdfDatabaseSchema
Inheritance
OdfDatabaseSchema
Inherited Members

Properties

Tables

Gets all currently defined table structures in the schema. 取得目前 Schema 中所有已定義的資料表結構。

public IReadOnlyList<OdfSchemaTable> Tables { get; }

Property Value

IReadOnlyList<OdfSchemaTable>

Methods

AddTable(OdfSchemaTable)

Adds a table structure to the schema. 新增一個資料表結構至 Schema 中。

public void AddTable(OdfSchemaTable table)

Parameters

table OdfSchemaTable

The table structure to add. / 要新增的資料表結構。

Exceptions

ArgumentNullException

When table is null. / 當 tablenull 時擲出。

InvalidOperationException

When a table with the same name already exists in the schema. / 當資料表名稱已存在於 Schema 中時擲出。

RemoveTable(string)

Removes the table structure with the specified name from the schema. 從 Schema 中移除指定名稱的資料表結構。

public bool RemoveTable(string tableName)

Parameters

tableName string

The name of the table to remove. / 要移除的資料表名稱。

Returns

bool

true if removed successfully; otherwise false. / 如果成功移除,則為 true;否則為 false

Exceptions

ArgumentException

When tableName is empty. / 當 tableName 為空時擲出。

Save()

Synchronizes the current schema state back to the database document. 將目前的結構描述狀態同步儲存回資料庫文件中。

public void Save()