pgbelt 0.7.5__tar.gz → 0.7.7__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.
Files changed (26) hide show
  1. {pgbelt-0.7.5 → pgbelt-0.7.7}/PKG-INFO +1 -1
  2. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/util/postgres.py +9 -3
  3. {pgbelt-0.7.5 → pgbelt-0.7.7}/pyproject.toml +12 -12
  4. {pgbelt-0.7.5 → pgbelt-0.7.7}/LICENSE +0 -0
  5. {pgbelt-0.7.5 → pgbelt-0.7.7}/README.md +0 -0
  6. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/__init__.py +0 -0
  7. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/__init__.py +0 -0
  8. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/convenience.py +0 -0
  9. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/helpers.py +0 -0
  10. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/login.py +0 -0
  11. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/preflight.py +0 -0
  12. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/schema.py +0 -0
  13. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/setup.py +0 -0
  14. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/status.py +0 -0
  15. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/sync.py +0 -0
  16. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/cmd/teardown.py +0 -0
  17. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/config/__init__.py +0 -0
  18. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/config/config.py +0 -0
  19. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/config/models.py +0 -0
  20. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/config/remote.py +0 -0
  21. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/main.py +0 -0
  22. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/util/__init__.py +0 -0
  23. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/util/asyncfuncs.py +0 -0
  24. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/util/dump.py +0 -0
  25. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/util/logs.py +0 -0
  26. {pgbelt-0.7.5 → pgbelt-0.7.7}/pgbelt/util/pglogical.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pgbelt
3
- Version: 0.7.5
3
+ Version: 0.7.7
4
4
  Summary: A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
5
5
  Author: Varjitt Jeeva
6
6
  Author-email: varjitt.jeeva@autodesk.com
@@ -15,9 +15,9 @@ async def dump_sequences(
15
15
  # Get all sequences in the schema
16
16
  seqs = await pool.fetch(
17
17
  f"""
18
- SELECT '{schema}' || '.' || sequence_name
18
+ SELECT '{schema}' || '.\"' || sequence_name
19
19
  FROM information_schema.sequences
20
- WHERE sequence_schema = '{schema}';
20
+ WHERE sequence_schema = '{schema}' || '\"';
21
21
  """
22
22
  )
23
23
 
@@ -28,7 +28,7 @@ async def dump_sequences(
28
28
  proper_sequence_names = []
29
29
  for seq in targeted_sequences:
30
30
  if f"{schema}." not in seq:
31
- proper_sequence_names.append(f"{schema}.{seq}")
31
+ proper_sequence_names.append(f'{schema}."{seq}"')
32
32
  else:
33
33
  proper_sequence_names.append(seq)
34
34
  targeted_sequences = proper_sequence_names
@@ -54,6 +54,12 @@ async def load_sequences(pool: Pool, seqs: dict[str, int], logger: Logger) -> No
54
54
  given a dict of sequence named mapped to values, set each sequence to the
55
55
  matching value
56
56
  """
57
+
58
+ # If seqs is empty, we have nothing to do. Skip the operation.
59
+ if not seqs:
60
+ logger.info("No sequences to load. Skipping sequence loading.")
61
+ return
62
+
57
63
  logger.info(f"Loading sequences {list(seqs.keys())}...")
58
64
  sql_template = "SELECT pg_catalog.setval('{}', {}, true);"
59
65
  sql = "\n".join([sql_template.format(k, v) for k, v in seqs.items()])
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pgbelt"
3
- version = "0.7.5"
3
+ version = "0.7.7"
4
4
  description = "A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication."
5
5
  authors = ["Varjitt Jeeva <varjitt.jeeva@autodesk.com>"]
6
6
  readme = "README.md"
@@ -18,15 +18,15 @@ tabulate = "^0.9.0"
18
18
  typer = ">=0.9,<0.13"
19
19
 
20
20
  [tool.poetry.dev-dependencies]
21
- black = "~24.4.2"
22
- pre-commit = "~3.7.1"
23
- flake8 = "^7.1.0"
21
+ black = "~24.8.0"
22
+ pre-commit = "~3.8.0"
23
+ flake8 = "^7.1.1"
24
24
  pytest-cov = "~5.0.0"
25
- pytest = "^8.2.2"
26
- coverage = {extras = ["toml"], version = "^7.5"}
27
- safety = "^3.2.4"
28
- mypy = "^1.10"
29
- xdoctest = {extras = ["colors"], version = "^1.1.5"}
25
+ pytest = "^8.3.2"
26
+ coverage = {extras = ["toml"], version = "^7.6"}
27
+ safety = "^3.2.7"
28
+ mypy = "^1.11"
29
+ xdoctest = {extras = ["colors"], version = "^1.2.0"}
30
30
  flake8-bandit = "~4.1.1"
31
31
  flake8-bugbear = ">=21.9.2"
32
32
  flake8-docstrings = "^1.6.0"
@@ -36,9 +36,9 @@ darglint = "^1.8.1"
36
36
  reorder-python-imports = "^3.13.0"
37
37
  pre-commit-hooks = "^4.6.0"
38
38
  Pygments = "^2.18.0"
39
- pyupgrade = "^3.16.0"
40
- pylint = "^3.2.5"
41
- pytest-asyncio = "~0.23.7"
39
+ pyupgrade = "^3.17.0"
40
+ pylint = "^3.2.7"
41
+ pytest-asyncio = "~0.24.0"
42
42
 
43
43
  [build-system]
44
44
  requires = ["poetry-core>=1.0.0", "setuptools"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes