{"id":48086,"library":"grpc-typeorm-infrastructure","title":"gRPC TypeORM Infrastructure","description":"A lightweight wrapper around TypeORM repository and service patterns that integrates with gRPC Boom for consistent error handling. Current stable version is 1.0.16, released sporadically with minor updates. It provides base classes (BaseRepository and BaseService) to standardize CRUD operations with hooks like preSave, preUpdate, preDelete, and preResult. Compared to other TypeORM wrappers, this library specifically targets gRPC services and generates gRPC-friendly error objects using gRPC Boom. It requires TypeORM, gRPC, and gRPC Boom as peer dependencies.","status":"active","version":"1.0.16","language":"javascript","source_language":"en","source_url":"https://github.com/nicolaspearson/grpc.typeorm.infrastructure","tags":["javascript","infrastructure","typeorm","grpc","boom","typescript"],"install":[{"cmd":"npm install grpc-typeorm-infrastructure","lang":"bash","label":"npm"},{"cmd":"yarn add grpc-typeorm-infrastructure","lang":"bash","label":"yarn"},{"cmd":"pnpm add grpc-typeorm-infrastructure","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core ORM used for entity definitions and database operations.","package":"typeorm","optional":false},{"reason":"Required for gRPC transport layer; library assumes gRPC is used.","package":"grpc","optional":false},{"reason":"Used to generate gRPC-friendly error objects.","package":"grpc-boom","optional":false}],"imports":[{"note":"Default export since v1.","wrong":"import { BaseRepository } from 'grpc-typeorm-infrastructure'","symbol":"BaseRepository","correct":"import BaseRepository from 'grpc-typeorm-infrastructure'"},{"note":"Named export.","wrong":"import BaseService from 'grpc-typeorm-infrastructure'","symbol":"BaseService","correct":"import { BaseService } from 'grpc-typeorm-infrastructure'"},{"note":"TypeScript type export.","wrong":"import ISearchQueryBuilderOptions from 'grpc-typeorm-infrastructure'","symbol":"ISearchQueryBuilderOptions","correct":"import { ISearchQueryBuilderOptions } from 'grpc-typeorm-infrastructure'"}],"quickstart":{"code":"import BaseRepository from 'grpc-typeorm-infrastructure';\nimport { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';\n\n@Entity()\nclass Hero {\n  @PrimaryGeneratedColumn()\n  id: number;\n  @Column()\n  name: string;\n}\n\nclass HeroRepository extends BaseRepository<Hero> {\n  constructor() {\n    super(Hero.name);\n  }\n}\n\n// Usage\nconst repo = new HeroRepository();\nconst hero = new Hero();\nhero.name = 'Superman';\nrepo.save(hero).then(console.log).catch(console.error);","lang":"typescript","description":"Shows how to define a TypeORM entity, extend BaseRepository, and perform a save operation."},"warnings":[{"fix":"Use super(Hero.name) instead of super(Hero).","message":"BaseRepository constructors require calling super with entity class name (string). Passing the class itself will cause a runtime error.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Handle errors using gRPC error handling patterns.","message":"The save/update/delete methods use gRPC Boom for error formatting; errors thrown will be gRPC objects, not plain Error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use delete(record: T, options?) instead of deleteOneById.","message":"The deleteOneById method is marked for deprecation; prefer delete method with record.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.16':26 'around':7 'base':34 'baserepositori':36 'baseservic':38 'boom':17,71,78,86 'class':35 'compar':51 'consist':19 'crud':41 'current':22 'depend':81 'error':20,67 'friend':66 'generat':63 'grpc':1,16,60,65,70,75,77,85 'grpc-friend':64 'handl':21 'hook':44 'infrastructur':3,83 'integr':14 'javascript':82 'librari':57 'lightweight':5 'like':45 'minor':30 'object':68 'oper':42 'pattern':12 'peer':80 'predelet':48 'preresult':50 'presav':46 'preupdat':47 'provid':33 'releas':27 'repositori':9 'requir':73 'servic':11,61 'specif':58 'sporad':28 'stabl':23 'standard':40 'target':59 'typeorm':2,8,54,74,84 'typescript':87 'updat':31 'use':69 'version':24 'wrapper':6,55","created_at":"2026-06-07T16:54:51.509550+00:00","updated_at":"2026-06-07T16:54:51.509550+00:00","problems":[{"fix":"Ensure correct import statement: import BaseRepository from 'grpc-typeorm-infrastructure'","cause":"Missing or incorrect import of BaseRepository or BaseService.","error":"TypeError: Class extends value undefined is not a constructor or null"},{"fix":"Pass the entity class name as string: super(Hero.name)","cause":"Calling super() in repository constructor with undefined entity name.","error":"Cannot read property 'name' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/nicolaspearson/grpc.typeorm.infrastructure#readme","github":"https://github.com/nicolaspearson/grpc.typeorm.infrastructure","docs":null,"changelog":null,"pypi":null,"npm":"grpc-typeorm-infrastructure","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}