Nessuna descrizione

config-shadow.yaml 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. #
  2. # Licensed to the Apache Software Foundation (ASF) under one or more
  3. # contributor license agreements. See the NOTICE file distributed with
  4. # this work for additional information regarding copyright ownership.
  5. # The ASF licenses this file to You under the Apache License, Version 2.0
  6. # (the "License"); you may not use this file except in compliance with
  7. # the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. #
  17. ######################################################################################################
  18. #
  19. # Here you can configure the rules for the proxy.
  20. # This example is configuration of shadow rule.
  21. #
  22. ######################################################################################################
  23. #
  24. #databaseName: shadow_db
  25. #
  26. #dataSources:
  27. # ds:
  28. # url: jdbc:postgresql://127.0.0.1:5432/demo_ds_0
  29. # username: postgres
  30. # password: postgres
  31. # connectionTimeoutMilliseconds: 30000
  32. # idleTimeoutMilliseconds: 60000
  33. # maxLifetimeMilliseconds: 1800000
  34. # maxPoolSize: 50
  35. # minPoolSize: 1
  36. # shadow_ds:
  37. # url: jdbc:postgresql://127.0.0.1:5432/demo_ds_1
  38. # username: postgres
  39. # password: postgres
  40. # connectionTimeoutMilliseconds: 30000
  41. # idleTimeoutMilliseconds: 60000
  42. # maxLifetimeMilliseconds: 1800000
  43. # maxPoolSize: 50
  44. # minPoolSize: 1
  45. #
  46. #rules:
  47. #- !SHADOW
  48. # dataSources:
  49. # shadowDataSource:
  50. # productionDataSourceName: ds
  51. # shadowDataSourceName: shadow_ds
  52. # tables:
  53. # t_order:
  54. # dataSourceNames:
  55. # - shadowDataSource
  56. # shadowAlgorithmNames:
  57. # - user_id_insert_match_algorithm
  58. # - user_id_select_match_algorithm
  59. # t_order_item:
  60. # dataSourceNames:
  61. # - shadowDataSource
  62. # shadowAlgorithmNames:
  63. # - user_id_insert_match_algorithm
  64. # - user_id_update_match_algorithm
  65. # - user_id_select_match_algorithm
  66. # t_address:
  67. # dataSourceNames:
  68. # - shadowDataSource
  69. # shadowAlgorithmNames:
  70. # - user_id_insert_match_algorithm
  71. # - user_id_select_match_algorithm
  72. # - sql_hint_algorithm
  73. # shadowAlgorithms:
  74. # user_id_insert_match_algorithm:
  75. # type: REGEX_MATCH
  76. # props:
  77. # operation: insert
  78. # column: user_id
  79. # regex: "[1]"
  80. # user_id_update_match_algorithm:
  81. # type: REGEX_MATCH
  82. # props:
  83. # operation: update
  84. # column: user_id
  85. # regex: "[1]"
  86. # user_id_select_match_algorithm:
  87. # type: REGEX_MATCH
  88. # props:
  89. # operation: select
  90. # column: user_id
  91. # regex: "[1]"
  92. # sql_hint_algorithm:
  93. # type: SQL_HINT
  94. # props:
  95. # foo: bar
  96. ######################################################################################################
  97. #
  98. # If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
  99. #
  100. ######################################################################################################
  101. #
  102. #databaseName: shadow_db
  103. #
  104. #dataSources:
  105. # ds:
  106. # url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
  107. # username: root
  108. # password:
  109. # connectionTimeoutMilliseconds: 30000
  110. # idleTimeoutMilliseconds: 60000
  111. # maxLifetimeMilliseconds: 1800000
  112. # maxPoolSize: 50
  113. # minPoolSize: 1
  114. # shadow_ds:
  115. # url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
  116. # username: root
  117. # password:
  118. # connectionTimeoutMilliseconds: 30000
  119. # idleTimeoutMilliseconds: 60000
  120. # maxLifetimeMilliseconds: 1800000
  121. # maxPoolSize: 50
  122. # minPoolSize: 1
  123. #
  124. #rules:
  125. #- !SHADOW
  126. # dataSources:
  127. # shadowDataSource:
  128. # productionDataSourceName: ds
  129. # shadowDataSourceName: shadow_ds
  130. # tables:
  131. # t_order:
  132. # dataSourceNames:
  133. # - shadowDataSource
  134. # shadowAlgorithmNames:
  135. # - user_id_insert_match_algorithm
  136. # - user_id_select_match_algorithm
  137. # t_order_item:
  138. # dataSourceNames:
  139. # - shadowDataSource
  140. # shadowAlgorithmNames:
  141. # - user_id_insert_match_algorithm
  142. # - user_id_update_match_algorithm
  143. # - user_id_select_match_algorithm
  144. # t_address:
  145. # dataSourceNames:
  146. # - shadowDataSource
  147. # shadowAlgorithmNames:
  148. # - user_id_insert_match_algorithm
  149. # - user_id_select_match_algorithm
  150. # - sql_hint_algorithm
  151. # shadowAlgorithms:
  152. # user_id_insert_match_algorithm:
  153. # type: REGEX_MATCH
  154. # props:
  155. # operation: insert
  156. # column: user_id
  157. # regex: "[1]"
  158. # user_id_update_match_algorithm:
  159. # type: REGEX_MATCH
  160. # props:
  161. # operation: update
  162. # column: user_id
  163. # regex: "[1]"
  164. # user_id_select_match_algorithm:
  165. # type: REGEX_MATCH
  166. # props:
  167. # operation: select
  168. # column: user_id
  169. # regex: "[1]"
  170. # sql_hint_algorithm:
  171. # type: SQL_HINT
  172. # props:
  173. # foo: bar