0

How can I change spring data r2dbc repositories target-datatabase (maybe I am talking about 'Context')?

Let me explain better.

I am managing(ConnectionFactory Properties) 'connection factory' to execute SQL-DDL scripts in any database I want - OK; however, R2dbcRepositories (REactiveCruRepository) methods, are not follow this database I have configured ConnectionFactory Properties.

How Can I change ConnectionFactory Properties, in order to, REactiveCruRepository points for this configuration done (meaning a new database)?

Honza Zidek
  • 9,204
  • 4
  • 72
  • 118
GtdDev
  • 748
  • 6
  • 14

1 Answers1

1

It is very easy to configure another connection factory for your R2dbc Repositories.

Check my example about multiple R2dbc connection factories.

Hantsy
  • 8,006
  • 7
  • 64
  • 109
  • I am studying your multi-tenancy-r2dbc(https://github.com/hantsy/spring-puzzles/tree/master/multi-tenancy-r2dbc). Why your scripting "Orders" and "Customer" in mysql-initdb.d? Why Did you do like that, if you have The Tenant Scripts in REsources? In other words, why Dou you have "default tenant schema" in mysql-initdb.d? Thx for your examples they are helping me a LOT. Thx – GtdDev Oct 11 '20 at 01:13
  • Just an example for the default(fallback) tenant if there is no tenant set. You can use any database there. – Hantsy Oct 11 '20 at 02:28