@itrocks/mysql-maintainer
Version:
Reactively maintains database structure by updating schema and retrying on MySQL errors
19 lines (18 loc) • 900 B
TypeScript
import { ObjectOrType } from '@itrocks/class-type';
import { Type } from '@itrocks/class-type';
import { Connection } from 'mariadb';
import { QueryOptions } from 'mariadb-share';
import { SqlError } from 'mariadb-share';
import { Context } from './contextual-connection';
export { Mysql } from './mysql';
export declare const DEBUG = false;
export declare class MysqlMaintainer {
connection: Connection;
constructor(connection: Connection);
createImplicitTable(type1: ObjectOrType, type2: ObjectOrType): Promise<boolean>;
createTable(type: Type): Promise<boolean>;
implicitTableName(type1: ObjectOrType, type2: ObjectOrType): string;
manageError(error: SqlError, context: Context, _sql: string | QueryOptions, _values: any[]): Promise<boolean>;
updateContextTables(context: Context, tableName?: string): Promise<boolean>;
updateTable(type: Type): Promise<boolean>;
}