Closed SolidZORO closed 3 years ago
@SolidZORO thank you for the question, but I don't know because I see sequelize-typescript first time :) If you have ideas, please feel free to post them here and do a PR.
Hi, I'm also trying now, and I'll update here or PR if I have results.
e.g. Nest.js + sequelize-typescript
// category.service.ts
import nestedSet from 'sequelize-nested-set';
@Injectable()
export class CategoryService {
constructor(
@InjectModel(Category) private readonly categoryRepo: typeof Category,
@InjectConnection() private sequelizeConnection: any,
) {
this.categoryRepo = nestedSet(this.categoryRepo, this.sequelizeConnection);
}
}
After completing it I found that I couldn't recursively classify it. https://github.com/fremail/sequelize-nested-set/issues/13 Just gave up using it. 😭
sequelize-typescript https://github.com/RobinBuschmann/sequelize-typescript