---
lang: en
title: 'API docs: typeorm.typeorm.repository'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/typeorm
permalink: /doc/en/lb4/apidocs.typeorm.typeorm.repository.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/typeorm](./typeorm.md) &gt; [typeorm](./typeorm.typeorm.md) &gt; [repository](./typeorm.typeorm.repository.md)

## typeorm.repository() function

<b>Signature:</b>

```typescript
function repository(entity: Function, connectionName?: string): (target: Object, member: string | undefined, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  entity | Function |  |
|  connectionName | string | <i>(Optional)</i> |

<b>Returns:</b>

(target: Object, member: string \| undefined, methodDescriptorOrParameterIndex?: number \| TypedPropertyDescriptor&lt;any&gt; \| undefined) =&gt; void


