You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/01/01 06:49:15 UTC

[GitHub] [shardingsphere] roodkcab opened a new issue #14472: route sql to write datasource based on username or listen address.

roodkcab opened a new issue #14472:
URL: https://github.com/apache/shardingsphere/issues/14472


   ## Feature Request
   
   ### Describe the feature you would like.
   read write split datasource can be routed through hint. but it'll be more convenient to use username or connection host to set hint automatically.
   
   example:
   when user name is `db_writeonly`, session could set writeonly hint automatically;
   
   or we can add a new property `writeOnlyHost` to read write split configuration, if user connect to database use `writeOnlyHost` then set writeonly hint automatically on that session. (it may difficult to get connection host, since host is always converted to IP address before connect to database. however, if user connect to database use lo network, we can distinguish different host ip, like 127.0.0.1, 127.0.0.2, and etc)
   


-- 
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] strongduanmu edited a comment on issue #14472: route sql to write datasource based on username or listen address.

Posted by GitBox <gi...@apache.org>.
strongduanmu edited a comment on issue #14472:
URL: https://github.com/apache/shardingsphere/issues/14472#issuecomment-1005509626


   Hi @roodkcab, we have provide [sql hint](https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/special-api/sharding/hint/#%E4%BD%BF%E7%94%A8-hint-%E8%B7%AF%E7%94%B1%E8%87%B3%E6%8C%87%E5%AE%9A%E6%95%B0%E6%8D%AE%E5%BA%93) in the master branch, I think you can try it. SQL hint can implement primary dataSource routing through comments in sql.
   
   ```sql
   /* ShardingSphere hint: writeRouteOnly=true */
   SELECT * FROM t_order;
   ```


-- 
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] tuichenchuxin commented on issue #14472: route sql to write datasource based on username or listen address.

Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #14472:
URL: https://github.com/apache/shardingsphere/issues/14472#issuecomment-1005311957


   @roodkcab Does it means config a userName, if it is same with the name used. Then using the writeOnly?


-- 
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] strongduanmu commented on issue #14472: route sql to write datasource based on username or listen address.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #14472:
URL: https://github.com/apache/shardingsphere/issues/14472#issuecomment-1005509626


   Hi @roodkcab, we have provide [sql hint](https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/special-api/sharding/hint/#%E4%BD%BF%E7%94%A8-hint-%E8%B7%AF%E7%94%B1%E8%87%B3%E6%8C%87%E5%AE%9A%E6%95%B0%E6%8D%AE%E5%BA%93) in the master branch. I think you can try it.


-- 
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] roodkcab commented on issue #14472: route sql to write datasource based on username or listen address.

Posted by GitBox <gi...@apache.org>.
roodkcab commented on issue #14472:
URL: https://github.com/apache/shardingsphere/issues/14472#issuecomment-1005347233


   > @roodkcab Does it means config a userName, if it is same with the name used. Then using the writeOnly?
   
   yes, it is.


-- 
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] roodkcab commented on issue #14472: route sql to write datasource based on username or listen address.

Posted by GitBox <gi...@apache.org>.
roodkcab commented on issue #14472:
URL: https://github.com/apache/shardingsphere/issues/14472#issuecomment-1005514573


   > Hi @roodkcab, we have provide [sql hint](https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/special-api/sharding/hint/#%E4%BD%BF%E7%94%A8-hint-%E8%B7%AF%E7%94%B1%E8%87%B3%E6%8C%87%E5%AE%9A%E6%95%B0%E6%8D%AE%E5%BA%93) in the master branch, I think you can try it. SQL hint can implement primary dataSource routing through comments in sql.
   > 
   > ```sql
   > /* ShardingSphere hint: writeRouteOnly=true */
   > SELECT * FROM t_order;
   > ```
   
   yes, I know. and we have distsql to change session based hint too. the need is to use hint by dsn, i.e. use host, port or username to set hint automatically. 


-- 
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