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 2021/09/09 08:10:12 UTC

[GitHub] [shardingsphere] CodingBingo opened a new issue #12307: Question about key generate when useing sharding-jdbc

CodingBingo opened a new issue #12307:
URL: https://github.com/apache/shardingsphere/issues/12307


   I am develop on master branch these days. when I transfer from mycat to ShardignSphere, I found that if I insert a record into my table, it will return a very large id.
   In our case, we want to control all database config in one place, so, we put different tables in one file, some of them are just single table in single database, we prefer use mysql auto increment id. I am wandering if ShardingSphere can add an arguments to determine if using keyGenerate or not.
   ```
   INSERT INTO `food` (`gmt_create`, `gmt_modified`, `name`, `photo`, `unit`, `school_id`)
   VALUES( '2020-03-31 21:51:58', '2020-03-31 21:51:58', 'egg', NULL, NULL, 100082);
   ```


-- 
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] tristaZero closed issue #12307: Question about key generate when useing sharding-jdbc

Posted by GitBox <gi...@apache.org>.
tristaZero closed issue #12307:
URL: https://github.com/apache/shardingsphere/issues/12307


   


-- 
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] CodingBingo commented on issue #12307: Question about key generate when useing sharding-jdbc

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


   > @CodingBingo Single table will not use id generator.
   I have a configuration file like this:
   ```
   schemaName: feedDataSource
   default: true
   
   dataSources:
     ds_feed_0:
       url: jdbc:mysql://*******/feeds
       dataSourceClassName: com.alibaba.druid.pool.DruidDataSource
       username: ****
       password: ****
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
     - !SHARDING
       tables:
         food:
           actualDataNodes: ds_feed_0.food
   
       defaultDatabaseStrategy:
         none:
       defaultTableStrategy:
         none:
       defaultKeyGenerateStrategy:
         column: none
         keyGeneratorName: none
   props:
     sql-show: true
   ```
   I enumerated all single tables in this config file to have full control of every table. I know that **ShardingSphere** can auto load table from physical database. 


-- 
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 #12307: Question about key generate when useing sharding-jdbc

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


   Hi @CodingBingo, this is a bug in 5.0.0-beta. You can use the latest master branch. This problem has been fixed.


-- 
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] CodingBingo commented on issue #12307: Question about key generate when useing sharding-jdbc

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


   > Hi @CodingBingo Could I have your WeChat connection? If it's possible, I am waiting for your response in my email ([panjuan@apache.org](mailto:panjuan@apache.org)). ;-)
   
   I have send my wechat to your email, I will explaine why we have this problem in the wecaht.


-- 
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] tristaZero commented on issue #12307: Question about key generate when useing sharding-jdbc

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


   It was fixed.


-- 
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] tristaZero commented on issue #12307: Question about key generate when useing sharding-jdbc

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


   @CodingBingo It looks a little strange. From my point, if users configure single tables in the configuration, these single tables are likely to be applied to these default strategies, e.g., `defaultKeyGenerateStrategy`. On the other hand, when ShardingSphere automatically loads single tables, which means they are really single tables (configured single tables approximately are viewed as one-shard sharding tables). In this case, database auto-increment property fits them.
   How do you think?


-- 
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] tristaZero commented on issue #12307: Question about key generate when useing sharding-jdbc

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


   Hi @CodingBingo Could I have your WeChat connection? If it's possible, I am waiting for your response in my email (panjuan@apache.org). ;-)


-- 
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 #12307: Question about key generate when useing sharding-jdbc

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


   @CodingBingo Single table will not use id generator.


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