import { ApplicationContract } from '../../Contracts/ApplicationContract'; /** * Model factory to seed database using Lucid * models * * @class DatabaseFactory * @constructor */ export declare class DatabaseFactory { protected app: ApplicationContract; tableName: string; dataCallback: (faker?: any, index?: number, data?: any) => any | Promise; protected _returningColumn: any; protected _connection: any; constructor(app: ApplicationContract, tableName: string, dataCallback: (faker?: any, index?: number, data?: any) => any | Promise); /** * Returns the query builder instance for * a given connection * * @method _getQueryBuilder * * @return {Object} * * @private */ protected _getQueryBuilder(): any; /** * Make a single instance of blueprint for a given * index. This method will evaluate the functions * in the return payload from blueprint. * * @method _makeOne * @async * * @param {Number} index * @param {Object} data * * @return {Object} * * @private */ protected _makeOne(index: any, data: any): Promise<{}>; /** * Set table to used for the database * operations * * @method table * * @param {String} tableName * * @chainable */ table(tableName: any): this; /** * Specify the returning column from the insert * query * * @method returning * * @param {String} column * * @chainable */ returning(column: any): this; /** * Specify the connection to be used on * the query builder * * @method connection * * @param {String} connection * * @chainable */ connection(connection: any): this; /** * Make a single model instance with attributes * from blueprint fake values * * @method make * @async * * @param {Object} data * @param {Number} [index = 0] * * @return {Object} */ make(data?: {}, index?: number): Promise<{}>; /** * Make x number of model instances with * fake data * * @method makeMany * @async * * @param {Number} instances * @param {Object} [data = {}] * * @return {Array} */ makeMany(instances: any, data?: {}): Promise<{}[]>; /** * Create model instance and persist to database * and then return it back * * @method create * @async * * @param {Object} data * * @return {Object} */ create(data?: {}, index?: number): Promise; /** * Persist multiple model instances to database and get * them back as an array * * @method createMany * @async * * @param {Number} numberOfRows * @param {Object} [data = {}] * * @return {Array} */ createMany(numberOfRows: any, data?: {}): Promise; /** * Truncate the database table * * @method reset * @async * * @return {Number} */ reset(): Promise; }