UNPKG

@athenna/database

Version:

The Athenna database handler for SQL/NoSQL.

31 lines (30 loc) 1 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 { BelongsToOptions } from '#src/types'; import type { BaseModel } from '#src/models/BaseModel'; import type { Driver } from '#src/database/drivers/Driver'; export declare class BelongsToRelation { /** * Get the options with defined default values. */ private static options; /** * Load a belongs to relation. */ static load(model: BaseModel, relation: BelongsToOptions): Promise<any>; /** * Load all models that belongs to relation. */ static loadAll(models: BaseModel[], relation: BelongsToOptions): Promise<any[]>; /** * Apply a where has relation to the query when the relation * is a belongs to the given model. */ static whereHas(Model: typeof BaseModel, query: Driver, relation: BelongsToOptions): void; }