Registry / database / dynamic-datasource-spring-boot-starter

dynamic-datasource-spring-boot-starter

JSON →
library4.5.0javamavenunverified

A Spring Boot starter that provides dynamic datasource switching for multi-tenant or multi-database applications.

<dependency> <groupId>com.baomidou</groupId> <artifactId>dynamic-datasource-spring-boot-starter</artifactId> <version>4.5.0</version> </dependency>
INSTALL
IMPORT
SIG · DYNAMIC-DATASOURCE
D
dynamic-datasource-spring-boot-starter
databasejavav4.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DS
com.baomidou.dynamic.datasource.annotation.DS

Use @DS annotation to switch datasource on a method.

import com.baomidou.dynamic.datasource.annotation.DS; import org.springframework.stereotype.Service; @Service public class MyService { @DS("slave") public void readFromSlave() { // This method uses the 'slave' datasource } }
Debug
Known issues
gotchaEnsure datasource names match exactly with configuration keys; mismatches cause runtime errors.
fix
Verify datasource names in application.yml/properties match @DS values.
affects: *
Upgrade
Version history
4.5.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
Amazon
1
Resources
dynamic-datasource-spring-boot-starter — mvn dependency:get dynamic-datasource-spring-boot-starter · libregistry