export interface SqlServerAuditStorageOptions { tableName?: string; } interface SqlServerSchemaClient { $executeRawUnsafe(query: string): Promise; } interface SqlServerInspectionClient { $queryRawUnsafe(query: string): Promise; } /** * Opt-in additive indexes for tenant-scoped SQL Server history queries. * Original NVARCHAR(MAX) values are unchanged. Queries must retain full-value * exact BIN2 equality and DATALENGTH predicates alongside matching BIN2 prefix * predicates. Prefixes alone do not establish identity equality. * Indexed computed columns require compatible SET options on every writer; * these installer batches configure only their own connections. */ export declare function getSqlServerAuditReadIndexStatements(options?: SqlServerAuditStorageOptions): string[]; /** Run with an installer identity. Batches are sequential, additive, and not atomic. */ export declare function applySqlServerAuditReadIndexes(prisma: SqlServerSchemaClient, options?: SqlServerAuditStorageOptions): Promise; export interface SqlServerAuditColumnInspection { name: string; type: string; maxLength: number; nullable: boolean; computed: boolean; scale: number; definition?: string; defaultDefinition?: string; } export interface SqlServerAuditIndexInspection { name: string; type: number; disabled: boolean; primaryKey: boolean; keys: Array<{ name: string; descending: boolean; }>; } export interface SqlServerAuditTriggerInspection { name: string; disabled: boolean; insteadOf: boolean; events: string[]; definitionAvailable: boolean; } export interface SqlServerAuditConstraintInspection { name: string; disabled: boolean; untrusted: boolean; definition?: string; } export interface SqlServerAuditStorageInspection { tableName: string; status: 'inspected' | 'missing' | 'unavailable'; metadataComplete: boolean; /** Catalog inspection does not prove a trigger body enforces append-only behavior. */ enforcementVerified: false; /** Effective options on this inspection connection, not every pooled writer. */ readIndexSessionCompatible: boolean | null; columns: SqlServerAuditColumnInspection[]; indexes: SqlServerAuditIndexInspection[]; triggers: SqlServerAuditTriggerInspection[]; constraints: SqlServerAuditConstraintInspection[]; issues: Array<{ code: string; object?: string; message: string; }>; /** Original inspection failure, when database access or result decoding failed. */ cause?: unknown; } /** * Read-only catalog diagnostics. Use an installer/diagnostic identity with VIEW * DEFINITION for complete results; INSERT-only runtime access remains sufficient * for logging. Missing metadata is never interpreted as an absent table unless * the connection is the effective database owner. A scope grant can still be * overridden by an object-level DENY, so it cannot prove absence on its own. */ export declare function inspectSqlServerAuditStorage(prisma: SqlServerInspectionClient, options?: SqlServerAuditStorageOptions): Promise; export {}; //# sourceMappingURL=sqlserver-maintenance.d.ts.map