How to use schema in sharding resolve? #16585
-
Hi! Question for version 5.1.1. Let's assume that we have the following sharding scheme. Is this configuration possible? How to configure datasources and their aliases as schema-specific for the correctly generated SQL-queries? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Hi @nexen505, if you want to use schema, you can config datasource like following: schemaName: sharding_db
dataSources:
ds_0:
url: jdbc:postgresql://127.0.0.1:5432/test?currentSchema=schema_0
username: postgres
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1
ds_1:
url: jdbc:postgresql://127.0.0.1:5432/test?currentSchema=schema_1
username: postgres
password: 123456
connectionTimeoutMilliseconds: 30000
idleTimeoutMilliseconds: 60000
maxLifetimeMilliseconds: 1800000
maxPoolSize: 50
minPoolSize: 1 Then you can include the schemaName in the executed statement, for example: |
Beta Was this translation helpful? Give feedback.
-
@nexen505 Sorry, ShardingSphere does not support the actual schema in postgresql now, we will consider enhancing this feature in the future. |
Beta Was this translation helpful? Give feedback.
-
Hello guys! Thanks for your input! Good news, we are developing the PostgreSQL logic scheme feature! And it's supposed to be released next 1.5 months. @strongduanmu I suppose we have such an issue, could we paste it here to let more guys interested in this one know the process. |
Beta Was this translation helpful? Give feedback.
@nexen505 Sorry, ShardingSphere does not support the actual schema in postgresql now, we will consider enhancing this feature in the future.