db-sync-tool-kmi 2.10.11__tar.gz → 2.11.0__tar.gz

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.

Files changed (39) hide show
  1. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/PKG-INFO +4 -2
  2. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/README.md +3 -1
  3. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/__main__.py +4 -0
  4. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/database/process.py +5 -0
  5. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/info.py +1 -1
  6. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/recipes/symfony.py +1 -1
  7. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/system.py +5 -1
  8. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool_kmi.egg-info/PKG-INFO +4 -2
  9. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/LICENSE +0 -0
  10. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/__init__.py +0 -0
  11. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/database/__init__.py +0 -0
  12. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/database/utility.py +0 -0
  13. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/recipes/__init__.py +0 -0
  14. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/recipes/drupal.py +0 -0
  15. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/recipes/laravel.py +0 -0
  16. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/recipes/typo3.py +0 -0
  17. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/recipes/wordpress.py +0 -0
  18. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/remote/__init__.py +0 -0
  19. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/remote/client.py +0 -0
  20. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/remote/rsync.py +0 -0
  21. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/remote/system.py +0 -0
  22. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/remote/transfer.py +0 -0
  23. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/remote/utility.py +0 -0
  24. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/sync.py +0 -0
  25. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/__init__.py +0 -0
  26. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/helper.py +0 -0
  27. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/info.py +0 -0
  28. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/log.py +0 -0
  29. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/mode.py +0 -0
  30. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/output.py +0 -0
  31. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/parser.py +0 -0
  32. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool/utility/validation.py +0 -0
  33. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool_kmi.egg-info/SOURCES.txt +0 -0
  34. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool_kmi.egg-info/dependency_links.txt +0 -0
  35. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool_kmi.egg-info/entry_points.txt +0 -0
  36. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool_kmi.egg-info/requires.txt +0 -0
  37. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/db_sync_tool_kmi.egg-info/top_level.txt +0 -0
  38. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/setup.cfg +0 -0
  39. {db_sync_tool-kmi-2.10.11 → db_sync_tool-kmi-2.11.0}/setup.py +0 -0
@@ -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
 
@@ -186,9 +186,11 @@ optional arguments:
186
186
  -ur, --use-rsync Use rsync as transfer method
187
187
  -uro USE_RSYNC_OPTIONS, --use-rsync-options USE_RSYNC_OPTIONS
188
188
  Additional rsync options
189
+ -w WHERE, --where WHERE
190
+ Additional where clause for mysql dump to sync only selected rows, e.g. --where="deleted=0"
189
191
  ```
190
192
 
191
- 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.
193
+ 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.
192
194
 
193
195
  ### Import
194
196
 
@@ -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(
@@ -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