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/06/28 04:56:14 UTC
[GitHub] [shardingsphere] azui007 opened a new issue, #18651: How to configure only the sharding database without configuring the sharding table
azui007 opened a new issue, #18651:
URL: https://github.com/apache/shardingsphere/issues/18651
## Question
# environment:
Sharding-JDBC 5.1.1
I have two databases(test1,test2), test1 save company A , test2 save company B。
Both databases have the same tables: **company_info1 - company_info1000**
# current configuration:
```
spring:
shardingsphere:
enabled: true
props:
sql-show: true
datasource:
names: test2,test1
test1:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/test1?useUnicode=true&characterEncoding=UTF-8
username: postgres
password: postgres
test2:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/test2?useUnicode=true&characterEncoding=UTF-8
username: postgres
password: postgres
rules:
sharding:
sharding-algorithms:
database-inline:
type: CLASS_BASED
props:
strategy: standard
algorithmClassName: com.aaa.bbb.sharedingpheredemo.algorith.CompanyCodePreciseShardingAlgorithm
tables:
company_info1:
actual-data-nodes: test$->{1..2}.company_info1
database-strategy:
standard:
sharding-column: company_code
sharding-algorithm-name: database-inline
company_info2:
actual-data-nodes: test$->{1..2}.company_info2
database-strategy:
standard:
sharding-column: company_code
sharding-algorithm-name: database-inline
default-database-strategy:
standard:
sharding-column: company_code
sharding-algorithm-name: database-inline
```
# Question
I configure sharding database rules for all tables , not need to configuring company_info1 to company_info1000 tables。
I try uesd **default-database-strategy**,but it not work for me.
can you help me
thank you
--
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] azui007 commented on issue #18651: How to configure only the sharding database without configuring the sharding table
Posted by GitBox <gi...@apache.org>.
azui007 commented on issue #18651:
URL: https://github.com/apache/shardingsphere/issues/18651#issuecomment-1181590181
Tables have been added one by one
--
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 #18651: How to configure only the sharding database without configuring the sharding table
Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #18651:
URL: https://github.com/apache/shardingsphere/issues/18651#issuecomment-1168794730
Please read the document 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
[GitHub] [shardingsphere] azui007 commented on issue #18651: How to configure only the sharding database without configuring the sharding table
Posted by GitBox <gi...@apache.org>.
azui007 commented on issue #18651:
URL: https://github.com/apache/shardingsphere/issues/18651#issuecomment-1168803404
Hi,I read a lot of documents and issues, but I didn't find any relevant guidelines。
I can shard tables by database, but the configuration is too complicated. Would like the configuration to be simpler
--
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] azui007 closed issue #18651: How to configure only the sharding database without configuring the sharding table
Posted by GitBox <gi...@apache.org>.
azui007 closed issue #18651: How to configure only the sharding database without configuring the sharding table
URL: https://github.com/apache/shardingsphere/issues/18651
--
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