This is a mysql and postgresql store procedure and trigger implementation of closure table in RDBMS about hierarchy data model.
Why do you think that https://github.com/LarnacaBeach/MsSql.Adapter is a good alternative to hierarchy-data-closure-table