dynamic-record
Version:
A bare minimum Javascript implementation of the Active Record pattern
16 lines (15 loc) • 763 B
TypeScript
import { TableSchema, SchemaDefinitions, IndexOptions, DynamicSchema as Schema } from "../DynamicSchema";
export declare class DynamicSchema extends Schema {
constructor({ connection }: {
connection: any;
});
createTable(schemaInput: TableSchema): Promise<DynamicSchema>;
dropTable(): Promise<DynamicSchema>;
renameTable(newSlug: string, newName?: string): Promise<DynamicSchema>;
addIndex(options: IndexOptions): Promise<DynamicSchema>;
removeIndex(columnName: string): Promise<DynamicSchema>;
read(tableSlug: string): Promise<DynamicSchema>;
define(def: SchemaDefinitions): Promise<DynamicSchema>;
renameColumn(name: string, newName: string): Promise<DynamicSchema>;
_writeSchema(): Promise<DynamicSchema>;
}