A TypeORM extension for managing adjacency list trees in PostgreSQL. Version 2.0.0 supports TypeORM >=0.3.0 and ships TypeScript definitions. Provides decorators (@Tree, @TreeParent, @TreeChildren) and tree repository methods (findTrees, findRoots, findDescendants, etc.) compatible with TypeORM's TreeRepository interface. Requires reflect-metadata as a peer dependency. Key differentiator: adjacency list approach (simple parent-child foreign key) rather than nested sets or materialized paths, and explicit ESM support with TypeORM 0.3+.
npm install typeorm-pg-adjacency-list-treeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows decorators usage (@Tree, TreeParent, TreeChildren), DataSource setup, and extendTreeRepository to get tree repository with findRoots.
Upgrade to TypeORM 0.3.x or higher. For TypeORM <0.3.0, use typeorm-pg-adjacency-list-tree <2.0.0.
Replace class-based TreeRepository with extendTreeRepository(dataSource.getRepository(Entity)).extend({...})Use 'import' syntax or set type: 'module' in package.json. For CommonJS projects, consider dynamic import().
Import @Tree from 'typeorm-pg-adjacency-list-tree' instead of 'typeorm'.
Ensure your entity class has @Tree() decorator before using tree repository.
Run 'npm install typeorm-pg-adjacency-list-tree'. Ensure tsconfig.json includes node module resolution.
Use extendTreeRepository from this package instead of TypeORM's TreeRepository.
Ensure DataSource is initialized and entity is registered in entities array.