pgdevkit 0.3.0__py3-none-any.whl → 0.3.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/db/crud.py +14 -3
- pgdevkit/testdb/mssql/constants.py +1 -1
- {pgdevkit-0.3.0.dist-info → pgdevkit-0.3.2.dist-info}/METADATA +1 -1
- {pgdevkit-0.3.0.dist-info → pgdevkit-0.3.2.dist-info}/RECORD +6 -6
- {pgdevkit-0.3.0.dist-info → pgdevkit-0.3.2.dist-info}/WHEEL +0 -0
- {pgdevkit-0.3.0.dist-info → pgdevkit-0.3.2.dist-info}/entry_points.txt +0 -0
pgdevkit/db/crud.py
CHANGED
|
@@ -157,8 +157,15 @@ async def pg_update_dict(
|
|
|
157
157
|
table_name: tuple[str, str],
|
|
158
158
|
data: dict,
|
|
159
159
|
primary_keys: Sequence[str],
|
|
160
|
+
*,
|
|
161
|
+
complex_helper: ComplexHelper | None = None,
|
|
160
162
|
) -> Any | None:
|
|
161
|
-
"""Update a row identified by primary_keys. Returns the raw row tuple.
|
|
163
|
+
"""Update a row identified by primary_keys. Returns the raw row tuple.
|
|
164
|
+
|
|
165
|
+
Pass `complex_helper` when the table has composite/enum columns among the
|
|
166
|
+
values being set — omitted, this behaves exactly as before (plain values
|
|
167
|
+
passed straight through to psycopg)."""
|
|
168
|
+
data = await _convert_complex_values(con, table_name, data, complex_helper)
|
|
162
169
|
set_parts = [
|
|
163
170
|
SQL("{col} = {val}").format(col=Identifier(k), val=Placeholder(k)) for k in data if k not in primary_keys
|
|
164
171
|
]
|
|
@@ -173,9 +180,13 @@ async def pg_update_dict(
|
|
|
173
180
|
return await cur.fetchone()
|
|
174
181
|
|
|
175
182
|
|
|
176
|
-
async def pg_update(
|
|
183
|
+
async def pg_update(
|
|
184
|
+
con: AsyncConnection, data: T, data_type: type[T], *, complex_helper: ComplexHelper | None = None
|
|
185
|
+
) -> Any | None:
|
|
177
186
|
"""Update a typed model instance."""
|
|
178
|
-
return await pg_update_dict(
|
|
187
|
+
return await pg_update_dict(
|
|
188
|
+
con, data_type.get_table_name(), data.model_dump(), data_type.get_primary_key(), complex_helper=complex_helper
|
|
189
|
+
)
|
|
179
190
|
|
|
180
191
|
|
|
181
192
|
async def pg_upsert_dict(
|
|
@@ -8,7 +8,7 @@ CONTAINER_NAME = "pgdevkit-mssql"
|
|
|
8
8
|
# emulated under Docker Desktop (slow, occasionally flaky startup). The
|
|
9
9
|
# documented escape hatch is mcr.microsoft.com/azure-sql-edge (multi-arch,
|
|
10
10
|
# missing a few full-SQL-Server features).
|
|
11
|
-
IMAGE = os.environ.get("PGDEVKIT_TESTDB_MSSQL_IMAGE", "mcr.microsoft.com/mssql/server:
|
|
11
|
+
IMAGE = os.environ.get("PGDEVKIT_TESTDB_MSSQL_IMAGE", "mcr.microsoft.com/mssql/server:2025-latest")
|
|
12
12
|
HOST = os.environ.get("PGDEVKIT_TESTDB_MSSQL_HOST", "localhost")
|
|
13
13
|
# Deliberately not SQL Server's native 1433 -- avoids colliding with a
|
|
14
14
|
# locally-installed instance, mirroring how the Postgres container's own
|
|
@@ -16,7 +16,7 @@ pgdevkit/backends/postgres.py,sha256=WseKjGrnPOS4RTGbT0tZRYbhooFp9eicerWTxKw93Bk
|
|
|
16
16
|
pgdevkit/db/__init__.py,sha256=GCO1jdkfCMnFB__g9LbwkEJiHJhDZ7opDgnaDgjA5eg,793
|
|
17
17
|
pgdevkit/db/complex_types.py,sha256=bv3oMztSnrhz4-OJROBXfiouL2jJ8TxpSR_83HMLmTI,11197
|
|
18
18
|
pgdevkit/db/connection.py,sha256=ylc_KVYsOvPeuW5GL1ebDDH0O3w93oe-EHwkUH4KoVs,5793
|
|
19
|
-
pgdevkit/db/crud.py,sha256=
|
|
19
|
+
pgdevkit/db/crud.py,sha256=t49aZmEJCIetn0du9OdWse3VSYAQe39S-jDaEt1SjmI,12537
|
|
20
20
|
pgdevkit/db/loader.py,sha256=0Swmp0h0s7I4acG0Dv3cem2YD4lFvq8aFEbFQPPQrxg,616
|
|
21
21
|
pgdevkit/db/model.py,sha256=ntuXonq-SCGkbNw-lvdMS5VuzLjxYRT8O6xaVqiw56I,980
|
|
22
22
|
pgdevkit/db/mssql_crud.py,sha256=yN4izZ0fsFwAs14008JECHH4dqjNbdHUHGEG8kidyNs,11374
|
|
@@ -32,13 +32,13 @@ pgdevkit/testdb/query.py,sha256=iYpy_EoYIq5USfwr6pNktmDjcGi_yQx0vHvjHZNGRr0,3854
|
|
|
32
32
|
pgdevkit/testdb/schema.py,sha256=oNf7qxK0HO5RqMb34-cw9PN3IVPcgK3nHDAi8lnzDIs,11072
|
|
33
33
|
pgdevkit/testdb/mssql/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
|
|
34
34
|
pgdevkit/testdb/mssql/api.py,sha256=42RAuJeiZlK1WJaTIYoj6l8GEAbEyt6LgAoF3G2jxnw,7537
|
|
35
|
-
pgdevkit/testdb/mssql/constants.py,sha256=
|
|
35
|
+
pgdevkit/testdb/mssql/constants.py,sha256=7n_NcYuhabbtb18CqG_H_rRbI7Wb_qu_l4nKk3281vI,2847
|
|
36
36
|
pgdevkit/testdb/mssql/container.py,sha256=_rG0AMDXrNwok_E60Xai0DZdRiZ6Ba1j3GaLUnSAueg,3364
|
|
37
37
|
pgdevkit/docs/database-layout.md,sha256=4GBwv4PA2cKHl2BxwLd-awLOe9he9ie4X6CpQWjIEyI,6820
|
|
38
38
|
pgdevkit/skills/pgdevkit/SKILL.md,sha256=6uxe6BQwOLexGiBpf00VTFTHOiWJo5k2Qqzu172rb4I,12156
|
|
39
39
|
pgdevkit/skills/pgdevkit/references/dynamic-sql.md,sha256=aTR1sx81moiTwaMaiOecaqk-9rT8y5Zxz7W1BoC3vK0,2774
|
|
40
40
|
pgdevkit/skills/pgdevkit/references/temporal-tables.md,sha256=LwZnItvQWI7bB0oRHxIfUc0ynnq7N0V5Mnv-QHvFN3Q,1364
|
|
41
|
-
pgdevkit-0.3.
|
|
42
|
-
pgdevkit-0.3.
|
|
43
|
-
pgdevkit-0.3.
|
|
44
|
-
pgdevkit-0.3.
|
|
41
|
+
pgdevkit-0.3.2.dist-info/METADATA,sha256=PejmT7yTG0w3vumLkDIjQqimrSPnIZV2PfkNHWWoMCo,8701
|
|
42
|
+
pgdevkit-0.3.2.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
43
|
+
pgdevkit-0.3.2.dist-info/entry_points.txt,sha256=FK2P55lf0WaGlOZJIINOGgCt8WB7ep0OnPsgnrp80bg,42
|
|
44
|
+
pgdevkit-0.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|