method IDatabaseService.getRepository
Since 0.1.0
IDatabaseService.getRepository<Entity, Id extends EntityKey = string>(entity: string): IRepository<Entity, Id>

Get a repository for the named entity type.

Type Parameters

Entity

Entity shape

Id extends EntityKey = string

Primary key type

Parameters

entity: string

Entity name (e.g. 'User')

Return Type

Repository for the entity

Usage

import { type IDatabaseService } from "database-plugin/src/index.ts";