config-shadow.yaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. #schemaName: 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. # enable: true
  49. # dataSources:
  50. # shadowDataSource:
  51. # sourceDataSourceName: ds
  52. # shadowDataSourceName: shadow_ds
  53. # tables:
  54. # t_order:
  55. # dataSourceNames:
  56. # - shadowDataSource
  57. # shadowAlgorithmNames:
  58. # - user-id-insert-match-algorithm
  59. # - user-id-select-match-algorithm
  60. # t_order_item:
  61. # dataSourceNames:
  62. # - shadowDataSource
  63. # shadowAlgorithmNames:
  64. # - user-id-insert-match-algorithm
  65. # - user-id-update-match-algorithm
  66. # - user-id-select-match-algorithm
  67. # t_address:
  68. # dataSourceNames:
  69. # - shadowDataSource
  70. # shadowAlgorithmNames:
  71. # - user-id-insert-match-algorithm
  72. # - user-id-select-match-algorithm
  73. # - simple-note-algorithm
  74. # shadowAlgorithms:
  75. # user-id-insert-match-algorithm:
  76. # type: COLUMN_REGEX_MATCH
  77. # props:
  78. # operation: insert
  79. # column: user_id
  80. # regex: "[1]"
  81. # user-id-update-match-algorithm:
  82. # type: COLUMN_REGEX_MATCH
  83. # props:
  84. # operation: update
  85. # column: user_id
  86. # regex: "[1]"
  87. # user-id-select-match-algorithm:
  88. # type: COLUMN_REGEX_MATCH
  89. # props:
  90. # operation: select
  91. # column: user_id
  92. # regex: "[1]"
  93. # simple-note-algorithm:
  94. # type: SIMPLE_NOTE
  95. # props:
  96. # shadow: true
  97. # foo: bar
  98. ######################################################################################################
  99. #
  100. # If you want to connect to MySQL, you should manually copy MySQL driver to lib directory.
  101. #
  102. ######################################################################################################
  103. #
  104. #schemaName: shadow_db
  105. #
  106. #dataSources:
  107. # ds:
  108. # url: jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false
  109. # username: root
  110. # password:
  111. # connectionTimeoutMilliseconds: 30000
  112. # idleTimeoutMilliseconds: 60000
  113. # maxLifetimeMilliseconds: 1800000
  114. # maxPoolSize: 50
  115. # minPoolSize: 1
  116. # shadow_ds:
  117. # url: jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false
  118. # username: root
  119. # password:
  120. # connectionTimeoutMilliseconds: 30000
  121. # idleTimeoutMilliseconds: 60000
  122. # maxLifetimeMilliseconds: 1800000
  123. # maxPoolSize: 50
  124. # minPoolSize: 1
  125. #
  126. #rules:
  127. #- !SHADOW
  128. # enable: true
  129. # dataSources:
  130. # shadowDataSource:
  131. # sourceDataSourceName: ds
  132. # shadowDataSourceName: shadow_ds
  133. # tables:
  134. # t_order:
  135. # dataSourceNames:
  136. # - shadowDataSource
  137. # shadowAlgorithmNames:
  138. # - user-id-insert-match-algorithm
  139. # - user-id-select-match-algorithm
  140. # t_order_item:
  141. # dataSourceNames:
  142. # - shadowDataSource
  143. # shadowAlgorithmNames:
  144. # - user-id-insert-match-algorithm
  145. # - user-id-update-match-algorithm
  146. # - user-id-select-match-algorithm
  147. # t_address:
  148. # dataSourceNames:
  149. # - shadowDataSource
  150. # shadowAlgorithmNames:
  151. # - user-id-insert-match-algorithm
  152. # - user-id-select-match-algorithm
  153. # - simple-note-algorithm
  154. # shadowAlgorithms:
  155. # user-id-insert-match-algorithm:
  156. # type: COLUMN_REGEX_MATCH
  157. # props:
  158. # operation: insert
  159. # column: user_id
  160. # regex: "[1]"
  161. # user-id-update-match-algorithm:
  162. # type: COLUMN_REGEX_MATCH
  163. # props:
  164. # operation: update
  165. # column: user_id
  166. # regex: "[1]"
  167. # user-id-select-match-algorithm:
  168. # type: COLUMN_REGEX_MATCH
  169. # props:
  170. # operation: select
  171. # column: user_id
  172. # regex: "[1]"
  173. # simple-note-algorithm:
  174. # type: SIMPLE_NOTE
  175. # props:
  176. # shadow: true
  177. # foo: bar