@iota-big3/sdk-security
Version:
Advanced security features including zero trust, quantum-safe crypto, and ML threat detection
45 lines • 1.25 kB
TypeScript
/**
* Database Contract for SDK Security
* Defines the interface that sdk-security expects from a database integration
*/
export interface SecurityDatabaseContract {
/**
* Insert data into a table
*/
insert(table: string, data: Record<string, unknown>): Promise<{
id: string;
affected: number;
}>;
/**
* Query data from database
* Returns object with rows array to match expected interface
*/
query<T = unknown>(sql: string, params?: unknown[]): Promise<{
rows: T[];
}>;
/**
* Update data in a table
*/
update(table: string, data: Record<string, unknown>, where: Record<string, unknown>): Promise<{
affected: number;
}>;
/**
* Delete data from a table
*/
delete(table: string, where: Record<string, unknown>): Promise<{
affected: number;
}>;
/**
* Execute a transaction
*/
transaction<T>(callback: (trx: any) => Promise<T>): Promise<T>;
/**
* Initialize the database connection
*/
initialize(): Promise<void>;
/**
* Create a table if it doesn't exist
*/
createTable?(name: string, schema: any): Promise<void>;
}
//# sourceMappingURL=database.contract.d.ts.map