You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "a1424132610 (via GitHub)" <gi...@apache.org> on 2023/05/19 03:14:42 UTC

[GitHub] [shardingsphere] a1424132610 opened a new issue, #25785: I can specify the data source through sql, right?

a1424132610 opened a new issue, #25785:
URL: https://github.com/apache/shardingsphere/issues/25785

   Since there are many tables in the database, I am now divided into two libraries. If I do not configure the logical table, can I specify the name of the data source when querying the table in sql? For example, the following sql:
   
   ```yaml
   dataSources:
     ds1:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       jdbcUrl: jdbc:mysql://localhost:3306/test1?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true
       username: root
       password: 123456
     ds2:
       dataSourceClassName: com.zaxxer.hikari.HikariDataSource
       driverClassName: com.mysql.cj.jdbc.Driver
       jdbcUrl: jdbc:mysql://localhost:3306/test2?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&useAffectedRows=true
       username: root
       password: 123456
   ```
   
   ```sql
   select * from ds1.user
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #25785: I can specify the data source through sql, right?

Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #25785:
URL: https://github.com/apache/shardingsphere/issues/25785#issuecomment-1554274171

   @a1424132610 I think it won't work, maybe you can use [SQL HINT](https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/sql-hint/)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz closed issue #25785: I can specify the data source through sql, right?

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz closed issue #25785: I can specify the data source through sql, right?
URL: https://github.com/apache/shardingsphere/issues/25785


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz commented on issue #25785: I can specify the data source through sql, right?

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #25785:
URL: https://github.com/apache/shardingsphere/issues/25785#issuecomment-1562135403

   Close it now. You could reopen it and reply later if necessary.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] a1424132610 commented on issue #25785: I can specify the data source through sql, right?

Posted by "a1424132610 (via GitHub)" <gi...@apache.org>.
a1424132610 commented on issue #25785:
URL: https://github.com/apache/shardingsphere/issues/25785#issuecomment-1554346385

   > @a1424132610 I think it won't work, maybe you can use [SQL HINT](https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/sql-hint/)
   
   I'll have a try, thanks
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org