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/12/16 03:14:59 UTC
[GitHub] [shardingsphere] 65725738 opened a new issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
65725738 opened a new issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103
The requirement is that I enter a different database based on a field in the SQL statement. There is only one rule. But I have thousands of tables, and I don't want to configure policies one by one. Can I configure only the database branch policy without the table branch policy? Is there an example?
--
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] 65725738 commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
65725738 commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-996498210

ShardingSphere rule configuration cannot be null or empty.
why?
--
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 #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-995406729
You can use defaultDatabaseStrategy like
```
rules:
- !SHARDING
defaultDatabaseStrategy:
standard:
shardingColumn: user_id
shardingAlgorithmName: database-inline
defaultTableStrategy:
none:
```
--
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] terrymanu commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-1005417453
Closed because of no response
--
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] 65725738 commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
65725738 commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-997527087
Multi-tenant, one database per tenant. and have thousands of tables.
--
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] terrymanu commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-997428306
What's mean of `database branch policy` and `table branch policy`?
--
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] 65725738 commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
65725738 commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-997510621
> What's mean of `database branch policy` and `table branch policy`?
I don't want to configure table rules one by one, I have thousands of tables. I need to configure only the database policy. all database have exactly the same table structure, and I decide which database to route to based on the ID.
--
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] 65725738 commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
65725738 commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-996484232
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'shardingSphereDataSource' defined in class path resource [org/apache/shardingsphere/spring/boot/ShardingSphereAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'shardingSphereDataSource' threw exception; nested exception is java.lang.IllegalArgumentException: ShardingSphere rule configuration cannot be null or empty.
--
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] terrymanu closed issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103
--
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] 65725738 commented on issue #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
65725738 commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-996483792
>
spring:
application:
name: task
shardingsphere:
datasource:
names: ds0,ds1
ds0:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://
username: root
password: 111
ds1:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql:
username: root
password: 111
rules:
defaultDatabaseStrategy:
standard:
shardingColumn: id
shardingAlgorithmName: database-inline
defaultTableStrategy:
none:
shardingAlgorithms:
database-inline:
type: INLINE
props:
algorithm-expression: ds$->{id % 2}
5.0.0 version
Is that right?
--
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 #14103: sharding Can you configure only the database branch policy but not the table branch policy?
Posted by GitBox <gi...@apache.org>.
tuichenchuxin commented on issue #14103:
URL: https://github.com/apache/shardingsphere/issues/14103#issuecomment-997532257
@65725738 Sorry to tell you it must config sharding tables, and you can only config default database strategy,but you should config sharding tables first.
--
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