Unable to use Postgres DB in gRPC gateway endpoint
SkelatorIndy opened this issue · comments
Zach 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!
Zach 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.