UNPKG

@athenna/database

Version:

The Athenna database handler for SQL/NoSQL.

31 lines (30 loc) 1.02 kB
/** * @athenna/database * * (c) João Lenon <lenon@athenna.io> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ import type { BaseModel } from '#src/models/BaseModel'; import type { BelongsToManyOptions } from '#src/types'; import type { Driver } from '#src/database/drivers/Driver'; export declare class BelongsToManyRelation { /** * Get the options with defined default values. */ private static options; /** * Load a belongs to many relation. */ static load(model: BaseModel, relation: BelongsToManyOptions): Promise<any>; /** * Load all models that belongs to relation. */ static loadAll(models: BaseModel[], relation: BelongsToManyOptions): Promise<any[]>; /** * Apply a where has relation to the query when the given model * belongs to many relations. */ static whereHas(Model: typeof BaseModel, query: Driver, relation: BelongsToManyOptions): void; }