@adonisjs/lucid
Version:
SQL ORM built on top of Active Record pattern
27 lines (26 loc) • 1.16 kB
TypeScript
/// <reference path="../../../adonis-typings/factory.d.ts" />
import { LucidModel, LucidRow } from '@ioc:Adonis/Lucid/Orm';
import { RelationCallback, FactoryModelContract, FactoryContextContract, FactoryBuilderQueryContract, FactoryRelationContract } from '@ioc:Adonis/Lucid/Factory';
/**
* Base relation to be extended by other factory relations
*/
export declare abstract class BaseRelation {
private factory;
protected ctx: FactoryContextContract;
private attributes;
parent: LucidRow;
constructor(factory: () => FactoryBuilderQueryContract<FactoryModelContract<LucidModel>>);
/**
* Instantiates the relationship factory
*/
protected compile(relation: FactoryRelationContract, parent: LucidRow, callback?: RelationCallback): import("@ioc:Adonis/Lucid/Factory").FactoryBuilderContract<FactoryModelContract<LucidModel>>;
/**
* Merge attributes with the relationship and its children
*/
merge(attributes: any): this;
/**
* Use custom ctx. This must always be called by the factory, otherwise
* `make` and `create` calls will fail.
*/
useCtx(ctx: FactoryContextContract): this;
}