CSqlTableModel
A flat editable model backed by an asynchronous SQL table adapter.
import { CSqlTableModel } from "canvas-toolkit-lib";Declared members
readonly loadingChanged: CSignal<[boolean]>;readonly errorOccurred: CSignal<[CSqlError]>;readonly dataSubmitted: CSignal<[CModelIndex]>;constructor(adapter: CSqlTableAdapter);adapter(): CSqlTableAdapter;setTable(table: string): void;table(): string;setPrimaryKey(column: string): void;primaryKey(): string;setColumns(columns: readonly string[]): void;columns(): readonly string[];setColumnHeader(column: string, label: string): void;setEditStrategy(strategy: CSqlEditStrategy): void;editStrategy(): CSqlEditStrategy;isLoading(): boolean;lastError(): CSqlError | null;setFetchSize(fetchSize: number): void;fetchSize(): number;totalRowCount(): number;sortColumn(): number;sortOrder(): CSortOrder;sort(column: number, order?: CSortOrder): void;filters(): readonly CSqlFilter[];setFilter(filter: CSqlFilter): void;setFilters(filters: readonly CSqlFilter[]): void;clearFilter(): void;canFetchMore(_parent?: CModelIndex): boolean;rowCount(_parent?: CModelIndex): number;columnCount(_parent?: CModelIndex): number;data(index: CModelIndex): unknown;headerData(section: number, orientation: COrientation): string | number | null;isEditable(index: CModelIndex): boolean;setItemData(index: CModelIndex, value: unknown): boolean;select(): Promise<boolean>;Reloads the complete table from the adapter.
fetchMore(_parent?: CModelIndex): Promise<boolean>;Appends the next block of rows when more data is available.
insertRecord(values: Readonly<CSqlRow>): Promise<boolean>;Inserts a record and appends the adapter-returned row to the model.
removeRow(row: number): Promise<boolean>;Removes a row after the adapter confirms deletion.
submitAll(): Promise<boolean>;Submits all pending changes.
submitRow(row: number): Promise<boolean>;Submits pending changes in one row.
revertAll(): void;Discards all changes that have not been submitted successfully.
whenIdle(): Promise<void>;Resolves when all automatically started writes have completed.
protected reportError(operation: CSqlOperation, error: unknown): void;Stores and emits an adapter error for subclasses implementing SQL operations.