pgbelt 0.7.3__py3-none-any.whl → 0.7.5__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.
- pgbelt/cmd/login.py +6 -1
- pgbelt/cmd/teardown.py +3 -3
- pgbelt/config/models.py +13 -3
- {pgbelt-0.7.3.dist-info → pgbelt-0.7.5.dist-info}/METADATA +2 -2
- {pgbelt-0.7.3.dist-info → pgbelt-0.7.5.dist-info}/RECORD +8 -8
- {pgbelt-0.7.3.dist-info → pgbelt-0.7.5.dist-info}/LICENSE +0 -0
- {pgbelt-0.7.3.dist-info → pgbelt-0.7.5.dist-info}/WHEEL +0 -0
- {pgbelt-0.7.3.dist-info → pgbelt-0.7.5.dist-info}/entry_points.txt +0 -0
pgbelt/cmd/login.py
CHANGED
|
@@ -55,7 +55,12 @@ async def revoke_logins(config_future: Awaitable[DbupgradeConfig]) -> None:
|
|
|
55
55
|
await _populate_logins(conf.src, pool, logger)
|
|
56
56
|
save_task = asyncio.create_task(conf.save())
|
|
57
57
|
|
|
58
|
-
to_disable = [
|
|
58
|
+
to_disable = []
|
|
59
|
+
# Sometimes the owner user is the same as the root user.
|
|
60
|
+
# When that happens, we don't want to disable the owner user.
|
|
61
|
+
# If the owner user is different, we want to disable the owner user.
|
|
62
|
+
if conf.src.owner_user.name != conf.src.root_user.name:
|
|
63
|
+
to_disable.append(conf.src.owner_user.name)
|
|
59
64
|
|
|
60
65
|
if conf.src.other_users is not None:
|
|
61
66
|
to_disable += [
|
pgbelt/cmd/teardown.py
CHANGED
|
@@ -42,13 +42,13 @@ async def teardown_forward_replication(config_future: Awaitable[DbupgradeConfig]
|
|
|
42
42
|
@run_with_configs
|
|
43
43
|
async def teardown(
|
|
44
44
|
config_future: Awaitable[DbupgradeConfig],
|
|
45
|
-
full: bool = Option(False, help="Remove pglogical
|
|
45
|
+
full: bool = Option(False, help="Remove pglogical extension"),
|
|
46
46
|
):
|
|
47
47
|
"""
|
|
48
48
|
Removes all pglogical configuration from both databases. If any replication is
|
|
49
|
-
configured this will stop it.
|
|
49
|
+
configured this will stop it. It will also drop the pglogical user.
|
|
50
50
|
|
|
51
|
-
If run with --full the pglogical
|
|
51
|
+
If run with --full the pglogical extension will be dropped.
|
|
52
52
|
|
|
53
53
|
WARNING: running with --full may cause the database to lock up. You should be
|
|
54
54
|
prepared to reboot the database if you do this.
|
pgbelt/config/models.py
CHANGED
|
@@ -10,6 +10,7 @@ from pgbelt.util.asyncfuncs import makedirs
|
|
|
10
10
|
from pydantic import BaseModel
|
|
11
11
|
from pydantic import ValidationError
|
|
12
12
|
from pydantic import field_validator
|
|
13
|
+
from urllib.parse import quote
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def config_dir(db: str, dc: str) -> str:
|
|
@@ -86,15 +87,24 @@ class DbConfig(BaseModel):
|
|
|
86
87
|
|
|
87
88
|
@property
|
|
88
89
|
def root_uri(self) -> str:
|
|
89
|
-
|
|
90
|
+
password = quote(
|
|
91
|
+
self.root_user.pw
|
|
92
|
+
) # https://github.com/encode/databases/issues/145#issuecomment-1303792343 need this to handle special characters
|
|
93
|
+
return f"postgresql://{self.root_user.name}:{password}@{self.ip}:{self.port}/{self.db}"
|
|
90
94
|
|
|
91
95
|
@property
|
|
92
96
|
def owner_uri(self) -> str:
|
|
93
|
-
|
|
97
|
+
password = quote(
|
|
98
|
+
self.owner_user.pw
|
|
99
|
+
) # https://github.com/encode/databases/issues/145#issuecomment-1303792343 need this to handle special characters
|
|
100
|
+
return f"postgresql://{self.owner_user.name}:{password}@{self.ip}:{self.port}/{self.db}"
|
|
94
101
|
|
|
95
102
|
@property
|
|
96
103
|
def pglogical_uri(self) -> str:
|
|
97
|
-
|
|
104
|
+
password = quote(
|
|
105
|
+
self.pglogical_user.pw
|
|
106
|
+
) # https://github.com/encode/databases/issues/145#issuecomment-1303792343 need this to handle special characters
|
|
107
|
+
return f"postgresql://{self.pglogical_user.name}:{password}@{self.ip}:{self.port}/{self.db}"
|
|
98
108
|
|
|
99
109
|
|
|
100
110
|
class DbupgradeConfig(BaseModel):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pgbelt
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.5
|
|
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
|
|
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Requires-Dist: aiofiles (>=0.8,<
|
|
13
|
+
Requires-Dist: aiofiles (>=0.8,<24.2)
|
|
14
14
|
Requires-Dist: asyncpg (>=0.27,<0.30)
|
|
15
15
|
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
16
16
|
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
|
@@ -2,16 +2,16 @@ pgbelt/__init__.py,sha256=0FxxDo2hLiQpxjY5NS48g2XC_nRMKPJf5X0aGIxmMo4,137
|
|
|
2
2
|
pgbelt/cmd/__init__.py,sha256=28SxbIChyvJ1mLoI8XJQPrPPwKA6852V9jtnFm8R0Nw,462
|
|
3
3
|
pgbelt/cmd/convenience.py,sha256=RY762BYoyOccmhHqSOaHWIPVBzY4kU0qZautTprGps0,5857
|
|
4
4
|
pgbelt/cmd/helpers.py,sha256=anMAkZjJRy7n0EwewyMNJGJ4Jx9keSNZdzWqi3ICNgI,5292
|
|
5
|
-
pgbelt/cmd/login.py,sha256=
|
|
5
|
+
pgbelt/cmd/login.py,sha256=FNg7shEIC2iwiDjOMza2ZvBv_33U1GMKRh51vsGMTb8,3351
|
|
6
6
|
pgbelt/cmd/preflight.py,sha256=-78Puqqf1rCxNQEyn4bQIAORez_tsy6zJAbSuO_de9s,20676
|
|
7
7
|
pgbelt/cmd/schema.py,sha256=XAAj2BH6HVoA1LxuWw2kheesGDu41L3GAd5UahNp3nE,4760
|
|
8
8
|
pgbelt/cmd/setup.py,sha256=Jp5sqT9_whoVBiOzAlOzX1ubtXQADYBkBrJldch_fKk,6627
|
|
9
9
|
pgbelt/cmd/status.py,sha256=LTvteFwA1jcfnGJdlA2siJn5TUtlf14ffMkGVSi5gi0,4730
|
|
10
10
|
pgbelt/cmd/sync.py,sha256=8TSNbn1dpkyxlEMImY7FjOrzhriSXlorqE-HBjqbUfU,9027
|
|
11
|
-
pgbelt/cmd/teardown.py,sha256=
|
|
11
|
+
pgbelt/cmd/teardown.py,sha256=Nl37vpugxO7QHO0tKpTfZDV0KtsSm0SbWUbzb3k2N-0,3545
|
|
12
12
|
pgbelt/config/__init__.py,sha256=SXok1aZcpMYJpX_hk5cuKO33CJ5s8IESkswNN9KsVSo,35
|
|
13
13
|
pgbelt/config/config.py,sha256=Kw2H-G1Evfj0TXIbh3k06gE72dZEp_wXWJ2Icq_T54c,3817
|
|
14
|
-
pgbelt/config/models.py,sha256=
|
|
14
|
+
pgbelt/config/models.py,sha256=YnsBYAa5hC-hcrbgd0-rYcpYYc4oU-cq7sRy0RsudY0,6357
|
|
15
15
|
pgbelt/config/remote.py,sha256=D9bOekVfMU1xX2Wy0OiJwSXetxJUdt9Tn5Fukwn9rnE,5307
|
|
16
16
|
pgbelt/main.py,sha256=YiagBiGt8pbNlukkRxROXnQX1Tx6ax7c6riuHRCrPYU,186
|
|
17
17
|
pgbelt/util/__init__.py,sha256=-6KkvVMz-yGNQfeoo4CZZrgWKXYmFd4CMyoiao8OnFE,40
|
|
@@ -20,8 +20,8 @@ pgbelt/util/dump.py,sha256=AwyOAd9CP014gvsl-qlo1lbnXZfxoeN4ujZWUIq7KM8,14715
|
|
|
20
20
|
pgbelt/util/logs.py,sha256=l2jT-WKZ-33eNDw4S4W1_eE4ISo4rtDRXYLVf4QTV4Y,1699
|
|
21
21
|
pgbelt/util/pglogical.py,sha256=Y6KZBeiH85zhNSvhATqh0xozhfUMyQnPWN1HwRosZFo,13613
|
|
22
22
|
pgbelt/util/postgres.py,sha256=jNMYhkb4OHYhNzDu7Fppz8wrXogAw1XxVhxdBA2e6cI,19270
|
|
23
|
-
pgbelt-0.7.
|
|
24
|
-
pgbelt-0.7.
|
|
25
|
-
pgbelt-0.7.
|
|
26
|
-
pgbelt-0.7.
|
|
27
|
-
pgbelt-0.7.
|
|
23
|
+
pgbelt-0.7.5.dist-info/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
|
|
24
|
+
pgbelt-0.7.5.dist-info/METADATA,sha256=-kYS6lLQlXAkSD5snpRYcHb78yPlmfWeAbGlKXMVwPM,2960
|
|
25
|
+
pgbelt-0.7.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
26
|
+
pgbelt-0.7.5.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
|
|
27
|
+
pgbelt-0.7.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|