Skip to content

@sourceloop/core / Exports / ICrudRepository

Interface: ICrudRepository<T, ID, Relations>

Type parameters

Name Type
T extends Entity
ID ID
Relations extends Object

Table of contents

Methods

Methods

count

count(where?, options?): Promise<Count>

Parameters

Name Type
where? Where<T>
options? AnyObject

Returns

Promise<Count>

Defined in

packages/core/src/components/tenant-utilities/types.ts:50


create

create(entity, options?): Promise<T>

Parameters

Name Type
entity DataObject<T>
options? AnyObject

Returns

Promise<T>

Defined in

packages/core/src/components/tenant-utilities/types.ts:26


createAll

createAll(entities, options?): Promise<T[]>

Parameters

Name Type
entities DataObject<T>[]
options? AnyObject

Returns

Promise<T[]>

Defined in

packages/core/src/components/tenant-utilities/types.ts:27


delete

delete(entity, options?): Promise<void>

Parameters

Name Type
entity T
options? AnyObject

Returns

Promise<void>

Defined in

packages/core/src/components/tenant-utilities/types.ts:40


deleteAll

deleteAll(where?, options?): Promise<Count>

Parameters

Name Type
where? Where<T>
options? AnyObject

Returns

Promise<Count>

Defined in

packages/core/src/components/tenant-utilities/types.ts:48


deleteById

deleteById(id, options?): Promise<void>

Parameters

Name Type
id ID
options? AnyObject

Returns

Promise<void>

Defined in

packages/core/src/components/tenant-utilities/types.ts:49


exists

exists(id, options?): Promise<boolean>

Parameters

Name Type
id ID
options? AnyObject

Returns

Promise<boolean>

Defined in

packages/core/src/components/tenant-utilities/types.ts:51


find

find(filter?, options?): Promise<T & Relations[]>

Parameters

Name Type
filter? Filter<T>
options? AnyObject

Returns

Promise<T & Relations[]>

Defined in

packages/core/src/components/tenant-utilities/types.ts:29


findById

findById(id, filter?, options?): Promise<T & Relations>

Parameters

Name Type
id ID
filter? FilterExcludingWhere<T>
options? AnyObject

Returns

Promise<T & Relations>

Defined in

packages/core/src/components/tenant-utilities/types.ts:34


findOne

findOne(filter?, options?): Promise<null | T & Relations>

Parameters

Name Type
filter? Filter<T>
options? AnyObject

Returns

Promise<null | T & Relations>

Defined in

packages/core/src/components/tenant-utilities/types.ts:30


replaceById

replaceById(id, data, options?): Promise<void>

Parameters

Name Type
id ID
data DataObject<T>
options? AnyObject

Returns

Promise<void>

Defined in

packages/core/src/components/tenant-utilities/types.ts:47


save

save(entity, options?): Promise<T>

Parameters

Name Type
entity T
options? AnyObject

Returns

Promise<T>

Defined in

packages/core/src/components/tenant-utilities/types.ts:28


update

update(entity, options?): Promise<void>

Parameters

Name Type
entity T
options? AnyObject

Returns

Promise<void>

Defined in

packages/core/src/components/tenant-utilities/types.ts:39


updateAll

updateAll(data, where?, options?): Promise<Count>

Parameters

Name Type
data DataObject<T>
where? Where<T>
options? AnyObject

Returns

Promise<Count>

Defined in

packages/core/src/components/tenant-utilities/types.ts:41


updateById

updateById(id, data, options?): Promise<void>

Parameters

Name Type
id ID
data DataObject<T>
options? AnyObject

Returns

Promise<void>

Defined in

packages/core/src/components/tenant-utilities/types.ts:46