adba
Version:
Any DataBase to API
11 lines (10 loc) • 637 B
TypeScript
import { Knex } from 'knex';
import { Model } from 'objection';
import { IGenerateModelsOptions } from './types';
/**
* Generates models based on the structure of the database specified in the Knex instance.
* @param {Knex} knexInstance - The Knex instance connected to the database.
* @param {IGenerateModelsOptions} [opts={}] - Options including parse and format functions.
* @returns {Promise<Record<string, typeof Model>>} - A promise that resolves to an object containing all generated models.
*/
export declare function generateModels(knexInstance: Knex, opts?: IGenerateModelsOptions): Promise<Record<string, typeof Model>>;