Open zKoz210 opened 1 month ago
This would be an interesting addition indeed. It would require a design phase so it is correctly included in the framework. This will probably involve breaking changes so it would be pushed back to v6.
In the meantime, you can work around this by opening another connection yourself using database.New(cfg, func() *slog.Logger { return server.Logger })
(or manually as usual in a Go project) and exposing this new connection through a service.
Proposal
Discussion:
I've worked a lot with Laravel and there is a handy thing like
DB::connection()
that allows you to connect multiple databases to one project. It would be really cool to see it here!For example:
And I would like to conveniently be able to set all connections through the configuration and refer to them by name
connection -
pgsql
connection -ch
connection -ch_analytics