pgdevkit 0.6.1__py3-none-any.whl → 0.6.2__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.
- pgdevkit/testdb/constants.py +7 -0
- pgdevkit/testdb/container.py +6 -1
- {pgdevkit-0.6.1.dist-info → pgdevkit-0.6.2.dist-info}/METADATA +1 -1
- {pgdevkit-0.6.1.dist-info → pgdevkit-0.6.2.dist-info}/RECORD +6 -6
- {pgdevkit-0.6.1.dist-info → pgdevkit-0.6.2.dist-info}/WHEEL +0 -0
- {pgdevkit-0.6.1.dist-info → pgdevkit-0.6.2.dist-info}/entry_points.txt +0 -0
pgdevkit/testdb/constants.py
CHANGED
|
@@ -11,6 +11,13 @@ PORT = int(os.environ.get("PGDEVKIT_TESTDB_PORT", "54322"))
|
|
|
11
11
|
USER = os.environ.get("PGDEVKIT_TESTDB_USER", "postgres")
|
|
12
12
|
PASSWORD = os.environ.get("PGDEVKIT_TESTDB_PASSWORD", "testpwd")
|
|
13
13
|
PG_SPEED_FLAGS = ["-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
|
|
14
|
+
# Production connects with session timezone=UTC; the container image's own default
|
|
15
|
+
# (baked into its base OS, not something pgdevkit ever set) can differ, silently
|
|
16
|
+
# making any ::date cast of a timestamptz column disagree between test and prod for
|
|
17
|
+
# rows near local midnight. Forcing UTC here -- both as the server's own timezone GUC
|
|
18
|
+
# and as PGTZ/TZ for any client library that consults the environment instead -- keeps
|
|
19
|
+
# test parity with prod instead of depending on the host/image's locale.
|
|
20
|
+
PG_STARTUP_FLAGS = [*PG_SPEED_FLAGS, "-c", "timezone=UTC"]
|
|
14
21
|
|
|
15
22
|
|
|
16
23
|
def conninfo(dbname: str, *, connect_timeout: int | None = None) -> str:
|
pgdevkit/testdb/container.py
CHANGED
|
@@ -36,8 +36,13 @@ def _create_container(client: docker.DockerClient) -> None:
|
|
|
36
36
|
environment={
|
|
37
37
|
"POSTGRES_USER": constants.USER,
|
|
38
38
|
"POSTGRES_PASSWORD": constants.PASSWORD,
|
|
39
|
+
# Belt-and-suspenders alongside the server's own -c timezone=UTC below:
|
|
40
|
+
# some client libraries/tools inside the container consult TZ/PGTZ
|
|
41
|
+
# directly instead of asking Postgres for its configured timezone.
|
|
42
|
+
"TZ": "UTC",
|
|
43
|
+
"PGTZ": "UTC",
|
|
39
44
|
},
|
|
40
|
-
command=["postgres", *constants.
|
|
45
|
+
command=["postgres", *constants.PG_STARTUP_FLAGS],
|
|
41
46
|
)
|
|
42
47
|
except docker.errors.APIError as e:
|
|
43
48
|
if getattr(e, "status_code", None) == 409 or "already in use" in str(e):
|
|
@@ -30,8 +30,8 @@ pgdevkit/testdb/__init__.py,sha256=LpdC2XMBxqn9JrGmXhIho3sK8O1aNo_aD7leKyBr-Lo,2
|
|
|
30
30
|
pgdevkit/testdb/_docker.py,sha256=kj_0xrGO_mxHlK83ilsB-yE0ELX1kpH22ruYrS-N3iU,1467
|
|
31
31
|
pgdevkit/testdb/api.py,sha256=K-y4O6nC3z_gr9LtVHe-v-T-1UjhmFMw1j-dLa0FcnY,7680
|
|
32
32
|
pgdevkit/testdb/config.py,sha256=vjcDr3jH3-5VakNAEMqQu_ZHPXiYIvM1_BSETSJW5QU,2164
|
|
33
|
-
pgdevkit/testdb/constants.py,sha256=
|
|
34
|
-
pgdevkit/testdb/container.py,sha256=
|
|
33
|
+
pgdevkit/testdb/constants.py,sha256=oykc7xoX2R0ykhjXpqIdwkZoeHcScme8S2UPYvi_d_w,1718
|
|
34
|
+
pgdevkit/testdb/container.py,sha256=PD2xUksIlAWXXus2VtAil_8UnwlG5DUcyUvbZx0eZTg,3123
|
|
35
35
|
pgdevkit/testdb/naming.py,sha256=Kyk5qEfxUkbggUG5bD7U7CJ_kAET332VPQNB-O5kvTY,1318
|
|
36
36
|
pgdevkit/testdb/query.py,sha256=iYpy_EoYIq5USfwr6pNktmDjcGi_yQx0vHvjHZNGRr0,3854
|
|
37
37
|
pgdevkit/testdb/schema.py,sha256=XYBK3xyay98a5gzFW6SAQ336Jge-NhOQhildSQDOaf4,15101
|
|
@@ -43,7 +43,7 @@ pgdevkit/docs/database-layout.md,sha256=j9N8GuT63D2oVf9rIOEv8GTWs4yTtjZTGH-zM5Wr
|
|
|
43
43
|
pgdevkit/skills/pgdevkit/SKILL.md,sha256=ADqEaQtMJPUUAiieqokzUUmIf27bWWJNB1ZvsfgiKAE,12205
|
|
44
44
|
pgdevkit/skills/pgdevkit/references/dynamic-sql.md,sha256=aTR1sx81moiTwaMaiOecaqk-9rT8y5Zxz7W1BoC3vK0,2774
|
|
45
45
|
pgdevkit/skills/pgdevkit/references/temporal-tables.md,sha256=LwZnItvQWI7bB0oRHxIfUc0ynnq7N0V5Mnv-QHvFN3Q,1364
|
|
46
|
-
pgdevkit-0.6.
|
|
47
|
-
pgdevkit-0.6.
|
|
48
|
-
pgdevkit-0.6.
|
|
49
|
-
pgdevkit-0.6.
|
|
46
|
+
pgdevkit-0.6.2.dist-info/METADATA,sha256=fwy52aFbJK5YxpalDkQhB5-ZS0q9P9ooDPSoRkMS5lY,18982
|
|
47
|
+
pgdevkit-0.6.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
48
|
+
pgdevkit-0.6.2.dist-info/entry_points.txt,sha256=FK2P55lf0WaGlOZJIINOGgCt8WB7ep0OnPsgnrp80bg,42
|
|
49
|
+
pgdevkit-0.6.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|