db-sync-tool-kmi 2.10.11__py3-none-any.whl → 2.11.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of db-sync-tool-kmi might be problematic. Click here for more details.

db_sync_tool/__main__.py CHANGED
@@ -247,6 +247,10 @@ def get_arguments(args):
247
247
  help='Additional rsync options',
248
248
  required=False,
249
249
  type=str)
250
+ parser.add_argument('-w', '--where',
251
+ help='Additional where clause for mysql dump to sync only selected rows',
252
+ required=False,
253
+ type=str)
250
254
 
251
255
  return parser.parse_args(helper.dict_to_args(args))
252
256
 
@@ -39,6 +39,11 @@ def create_origin_database_dump():
39
39
  semantic_version.Version(_database_version[1]) < semantic_version.Version('5.6.0'):
40
40
  _mysqldump_options = ''
41
41
 
42
+ # Adding additional where clause to sync only selected rows
43
+ if not system.config['where'] is '':
44
+ _where = system.config['where']
45
+ _mysqldump_options = _mysqldump_options + f'--where=\'{_where}\' '
46
+
42
47
  # Run mysql dump command, e.g.
43
48
  # MYSQL_PWD="db" mysqldump --no-tablespaces -u'db' -p'db' -h'db1' -P'3306' 'db' > /tmp/_db_08-10-2021_07-00.sql
44
49
  mode.run_command(
db_sync_tool/info.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """
2
2
  Info script
3
3
  """
4
- __version__ = "2.10.11"
4
+ __version__ = "2.11.0"
5
5
  __pypi_package_url__ = "https://pypi.org/pypi/db-sync-tool-kmi"
6
6
  __homepage__ = "https://github.com/jackd248/db-sync-tool"
@@ -49,7 +49,7 @@ def parse_database_credentials(db_credentials):
49
49
  """
50
50
  db_credentials = str(db_credentials).replace('\\n\'','')
51
51
  # DATABASE_URL=mysql://db-user:1234@db-host:3306/db-name
52
- pattern = r'^DATABASE_URL=(?P<db_type>\w+)://(?P<user>[^:]+):(?P<password>[^@]+)@(?P<host>[^:]+):(?P<port>\d+)/(?P<name>[^?]+)(?:\?.*)?$'
52
+ pattern = r'^DATABASE_URL=(?P<db_type>\w+):\/\/(?P<user>[^:]+):(?P<password>[^@]+)@(?P<host>[^:]+):(?P<port>\d+)\/(?P<name>[^?]+)(?:\?.*)?$'
53
53
 
54
54
  match = re.match(pattern, db_credentials)
55
55
 
@@ -42,7 +42,8 @@ config = {
42
42
  },
43
43
  'link_target': None,
44
44
  'link_origin': None,
45
- 'tables': ''
45
+ 'tables': '',
46
+ 'where': ''
46
47
  }
47
48
 
48
49
  #
@@ -249,6 +250,9 @@ def build_config(args, pre_run = False):
249
250
  check_config_dict_key(mode.Client.ORIGIN, 'db')
250
251
  config[mode.Client.ORIGIN]['db']['port'] = args.origin_db_port
251
252
 
253
+ if not args.where is None:
254
+ config['where'] = args.where
255
+
252
256
  return config
253
257
 
254
258
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: db-sync-tool-kmi
3
- Version: 2.10.11
3
+ Version: 2.11.0
4
4
  Summary: Synchronize a database from and to host systems.
5
5
  Home-page: https://github.com/jackd248/db-sync-tool
6
6
  Author: Konrad Michalik
@@ -217,9 +217,11 @@ optional arguments:
217
217
  -ur, --use-rsync Use rsync as transfer method
218
218
  -uro USE_RSYNC_OPTIONS, --use-rsync-options USE_RSYNC_OPTIONS
219
219
  Additional rsync options
220
+ -w WHERE, --where WHERE
221
+ Additional where clause for mysql dump to sync only selected rows, e.g. --where="deleted=0"
220
222
  ```
221
223
 
222
- If you haven't declare a path to a SSH key, during the script execution you are requested to enter the SSH password for the given user in the shell argument or the `config.json` to enable a SSH connection for the remote system.
224
+ If you haven't declared a path to a SSH key, during the script execution you are requested to enter the SSH password for the given user in the shell argument or the `config.json` to enable a SSH connection for the remote system.
223
225
 
224
226
  ### Import
225
227
 
@@ -1,14 +1,14 @@
1
1
  db_sync_tool/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- db_sync_tool/__main__.py,sha256=Scu3iAaWTDfMIdQcKnAF3uftUyZDqZcXZUbexSRMrPg,11038
3
- db_sync_tool/info.py,sha256=fQhlFUOmoCpA6N6FjuZ0P_DRTYn3F81QpZFt2OGvF58,166
2
+ db_sync_tool/__main__.py,sha256=xTsq9Jr2fT56Ek8_0IossireV2F9UkTLDngAPk07wr4,11251
3
+ db_sync_tool/info.py,sha256=mKEVsebw75tHib9r0EQWPKN7YPk-H-StL6by807vyM4,165
4
4
  db_sync_tool/sync.py,sha256=WMfMts0M8z3oecI-HL07xG9ktbba8D8h7_U-8tBwizY,2087
5
5
  db_sync_tool/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- db_sync_tool/database/process.py,sha256=bgqNWzLK71IrGpyHaS3VAChUvQjgS6OJV9LK5zv8aU8,7775
6
+ db_sync_tool/database/process.py,sha256=QvRW7A8-FLMEIt7krrKJPy9swq5nvL95PjOrfC29LMk,8012
7
7
  db_sync_tool/database/utility.py,sha256=EfxWwHUsS6hVIMD4Jrz3n2_HQNBn3pB2GWo6OpWph4k,7783
8
8
  db_sync_tool/recipes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  db_sync_tool/recipes/drupal.py,sha256=jlWuSQQeoLkVBq6nqka853QnEyy2ZO_08o5mfkv0jDo,1481
10
10
  db_sync_tool/recipes/laravel.py,sha256=-iF-2SHh5tOKuOC4C2qQMdz_sn9gm0-TBN9XpiYEuC4,1151
11
- db_sync_tool/recipes/symfony.py,sha256=25A9i7PWtZ5PEAr4APVBJWxlRAsBhtfLafUKaop_TTs,2490
11
+ db_sync_tool/recipes/symfony.py,sha256=rk2epXLEBLfsNTiV5G43JUnJtjn5-JTtnhQFi-tgmJQ,2493
12
12
  db_sync_tool/recipes/typo3.py,sha256=7ThFTkqN086FcpYv_aUhxMTEKh2JQl6BB5VrFzNrEWA,4737
13
13
  db_sync_tool/recipes/wordpress.py,sha256=Cdjc10c30shHAG8WpQeFvhl8fojHeCto3UInRLb9FFU,1444
14
14
  db_sync_tool/remote/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -24,11 +24,11 @@ db_sync_tool/utility/log.py,sha256=OdJsVKyvJqQYl5NUzb5bIg1uhUJ9kj7c7kT9oKbGvo8,8
24
24
  db_sync_tool/utility/mode.py,sha256=ijmCb7CC8cYnjaD7kBhNYAWm8_3rYSk4NeY7CfG4JPk,8571
25
25
  db_sync_tool/utility/output.py,sha256=uoiWE7Pm8qv1a3vrBupZHE545d1uZSQHiLAUgkHofLM,4758
26
26
  db_sync_tool/utility/parser.py,sha256=DIdWVGyiltyH8akoWyyXLvUmFPR-nvBrnzDctPJzgKw,6624
27
- db_sync_tool/utility/system.py,sha256=HVLArMYjOyaMGOPiv5Z3bw2rLVXjvuzPCMK_ug6HI5w,18275
27
+ db_sync_tool/utility/system.py,sha256=qIhmH11jQ8MlQe-VH52AlkZDul4E-2yB9EKrNMeD3Hs,18361
28
28
  db_sync_tool/utility/validation.py,sha256=qZNPgkTwV_kJTNtFh0OXb2FHrsWPnDA2W_fftWs5hZc,3530
29
- db_sync_tool_kmi-2.10.11.dist-info/LICENSE,sha256=o_R9gPKBRl4PQVcGCrWuTYsJQJ7uuQDcDaq-wapBUaw,1082
30
- db_sync_tool_kmi-2.10.11.dist-info/METADATA,sha256=ASKNc44ZS_WZooG18Czznj4RzcJjhk6lyauzQ0UvyYU,12166
31
- db_sync_tool_kmi-2.10.11.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
32
- db_sync_tool_kmi-2.10.11.dist-info/entry_points.txt,sha256=bVk6UR_ejpfY2oSCoOii7uKQivwV9MtA6Tdqpjg4Yvo,60
33
- db_sync_tool_kmi-2.10.11.dist-info/top_level.txt,sha256=Uj5hJLhmdynFrBE0VnX0PfgIBC8_n7h2vgldqUQ-xfw,13
34
- db_sync_tool_kmi-2.10.11.dist-info/RECORD,,
29
+ db_sync_tool_kmi-2.11.0.dist-info/LICENSE,sha256=o_R9gPKBRl4PQVcGCrWuTYsJQJ7uuQDcDaq-wapBUaw,1082
30
+ db_sync_tool_kmi-2.11.0.dist-info/METADATA,sha256=DBVHCEyuNwJap5XGngX--GeBhZIidHh2gd-OBvieWjw,12308
31
+ db_sync_tool_kmi-2.11.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
32
+ db_sync_tool_kmi-2.11.0.dist-info/entry_points.txt,sha256=bVk6UR_ejpfY2oSCoOii7uKQivwV9MtA6Tdqpjg4Yvo,60
33
+ db_sync_tool_kmi-2.11.0.dist-info/top_level.txt,sha256=Uj5hJLhmdynFrBE0VnX0PfgIBC8_n7h2vgldqUQ-xfw,13
34
+ db_sync_tool_kmi-2.11.0.dist-info/RECORD,,