rookie-ninja / rk-boot

Build microservice with rk-boot and let the team take over clean and tidy code.

Home Page:https://rkdev.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use Postgres DB in gRPC gateway endpoint

SkelatorIndy opened this issue · comments

commented

There doesn't appear to be any way to use a database driver in gRPC endpoints. You have to register endpoints prior to bootstrapping the program, but you cannot access the DB instance until after bootstrapping the program, meaning the DB instance is inaccessible until after setting up gRPC endpoints.
If there is a way I missed, or some kind of workaround, please let me know. Thanks!

commented

UPDATE
Found the work around to be to pass the database plugin instance to the gRPC handler, and then fetch the database itself within the handler, which would only happen after bootstrapping.