wp-host
Version:
Automated WordPress hosting deployment tool for bulk site creation with MySQL database management
54 lines • 1.66 kB
TypeScript
import { Config, SiteConfig, DeploymentResult } from "./types";
export declare class DatabaseManager {
private mysqlManager;
private config;
constructor(config: Config);
/**
* Initialize database manager and establish MySQL connection
*/
initialize(): Promise<void>;
/**
* Create databases and users for all sites in the configuration
*/
createAllDatabases(useExisting?: boolean): Promise<DeploymentResult[]>;
/**
* Create database and user for a single site
*/
createSiteDatabase(site: SiteConfig, useExisting?: boolean): Promise<DeploymentResult>;
/**
* Check if database and user already exist for a site
*/
checkSiteDatabase(site: SiteConfig): Promise<{
databaseExists: boolean;
userExists: boolean;
canConnect: boolean;
}>;
/**
* Generate database creation report
*/
generateReport(): Promise<void>;
/**
* Reset WordPress tables in all databases (keeps databases and users intact)
* This is safer than full cleanup as it only removes WordPress data
*/
resetWordPressTables(): Promise<void>;
/**
* Clean up (remove) databases and users for all sites
* WARNING: This will delete all data!
*/
cleanupAllDatabases(): Promise<void>;
/**
* Close database manager and disconnect from MySQL
*/
close(): Promise<void>;
/**
* Get database creation summary
*/
getSummary(results: DeploymentResult[]): {
total: number;
successful: number;
failed: number;
skipped: number;
};
}
//# sourceMappingURL=database-manager.d.ts.map