Giter Site home page Giter Site logo

Comments (4)

lecousin avatar lecousin commented on June 2, 2024

Hi,
If you are using MySQL, you should do the following:

  1. Add the dependency
<dependency>
  <groupId>net.lecousin.reactive-data-relational</groupId>
  <artifactId>mysql</artifactId>
  <version>0.4.1</version>
</dependency>
  1. Add in your app a configuration class extending MySqlConfiguration, that has to provide the connection factory.
@Configuration
public class DBConfiguration extends MySqlConfiguration {

	@Override
	@Bean
	public ConnectionFactory connectionFactory() {
		return ConnectionFactories.get(
		    "r2dbcs:mysql://localhost:3306/bin-springreactive"
		);
	}
	
}

Can you try this ?

I keep this issue open, because I think we should provide a way to use the connection details from the application.yml instead of specifying it in the code

from lc-spring-data-r2dbc.

lecousin avatar lecousin commented on June 2, 2024

Hi,

I made a new version and updated the README, to support configuration through application properties.

In order to use your connection configured in application.yml, you can upgrade your dependency to 0.4.2:

<dependency>
  <groupId>net.lecousin.reactive-data-relational</groupId>
  <artifactId>mysql</artifactId>
  <version>0.4.2</version>
</dependency>

And add this annotation to your application class (SpringDataR2dbcApplication):

@Import(MySqlConfiguration.class)

No more need to define the class DBConfiguration from my previous comment.

Can you confirm it solves your issue ?

Thanks for your feedback

from lc-spring-data-r2dbc.

wang-xiaowu avatar wang-xiaowu commented on June 2, 2024

thanks
i'll try later

from lc-spring-data-r2dbc.

lecousin avatar lecousin commented on June 2, 2024

As I didn't receive feedback, I'm closing this ticket because it has been answered. Please re-open if you still have an issue.

from lc-spring-data-r2dbc.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.