Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否通过前端指定连接那个数据源? #151

Open
yangjinju opened this issue Nov 16, 2020 · 2 comments
Open

能否通过前端指定连接那个数据源? #151

yangjinju opened this issue Nov 16, 2020 · 2 comments

Comments

@yangjinju
Copy link

您好,我这边想用前端传入一个 datasourceid,然后后台根据这个参数动态的去 redis(获取其他第三方) 获取数据源的信息(账号,密码,DBuri),再跟 DB 进行连接返回。实际上就是可能有多个DB实例,想让前端根据参数来实现跟哪个DB进行交互,请问这个该怎么实现?
前端参数可能如下:
{ "[]": { "User": { "sex": 1 } }, "datasourceid": 1 // 数据源ID,后台可以根据数据源ID动态的获取数据源的账号,密码,url }

目前是一个后台服务只能支持一个数据源?

@TommyLemon
Copy link
Collaborator

#148 (comment)

@TommyLemon
Copy link
Collaborator

TommyLemon commented Jun 15, 2021

新增数据源关键词 @Datasource,可由业务完全自定义
https://github.com/Tencent/APIJSON/releases/tag/4.7.0

新增 连接池及多数据源 Demo(Druid + HikariCP)
https://gitee.com/APIJSON/APIJSON-Demo/tree/master/APIJSON-Java-Server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants