---
title: "Discussion on \"Creating and Using Custom Repositories in NestJS with TypeORM 0.3\" | Hashnode"
description: "Discussion on \"Creating and Using Custom Repositories in NestJS with TypeORM 0.3\". Detailed step by step instructions on how to implement custom repository with NestJS and latest version of typeorm"
url: "https://hashnode.com/posts/custom-repositories-in-nestjs-typeorm3/63cbc45d587fc59d3cd74d45"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Creating and Using Custom Repositories in NestJS with TypeORM 0.3](https://durgadas.in/custom-repositories-in-nestjs-typeorm3?utm_source=hashnode&utm_medium=feed)

Detailed step by step instructions on how to implement custom repository with NestJS and latest version of typeorm

Dec 31, 2022 · 5 min read · durgadas.in  
Read the article

-   [#nestjs](https://hashnode.com/tag/nestjs)
-   [#typeorm](https://hashnode.com/tag/typeorm)
-   [#repository](https://hashnode.com/tag/repository)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#databases](https://hashnode.com/tag/databases)

## Written by

[Durgadas Kamath](https://hashnode.com/@durgadas)

@durgadas · India

  
[View profile](https://hashnode.com/@durgadas)

Inspire the Next.

Principal Architect | Driving Cloud Transformation &amp; Application Modernization with AWS &amp; IBM Cloud | Serverless &amp; DevOps Leader | Industry Speaker

## Responses 1

Markdown supported · ⌘↵ to post

[Gianluca Di Gesaro](https://hashnode.com/@gdg87)

[Mar 17, 2023](https://hashnode.com/posts/custom-repositories-in-nestjs-typeorm3/63cbc45d587fc59d3cd74d45/comment/64149c5ee10dd0be8d24826e)

Hello Durgadas, great article. I try to use a custom repository in an helper class outside nestjs service, how I can instatiate this class passing the repository as parameter?

[Durgadas Kamath](https://hashnode.com/@durgadas)

[Mar 22, 2023](https://hashnode.com/posts/custom-repositories-in-nestjs-typeorm3/63cbc45d587fc59d3cd74d45/comment/64149c5ee10dd0be8d24826e#reply-641a7a10e592dd06478df198)

As long as you have exposed the repository within the module under exports , you should be able to inject it outside of the current service.
