You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+33-1Lines changed: 33 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ A minimal Python SDK to use Microsoft Dataverse as a database for Azure AI Found
5
5
- Read (SQL) — Execute read-only T‑SQL via the McpExecuteSqlQuery Custom API. Returns `list[dict]`.
6
6
- OData CRUD — Thin wrappers over Dataverse Web API (create/get/update/delete).
7
7
- Bulk create — Pass a list of records to `create(...)` to invoke the bound `CreateMultiple` action; returns `list[str]` of GUIDs. If `@odata.type` is absent the SDK resolves the logical name from metadata (cached).
8
+
- Bulk update — Call `update_multiple(entity_set, records)` to invoke the bound `UpdateMultiple` action; returns nothing (transactional fire-and-forget). Each record must include the real primary key attribute (e.g. `accountid`).
8
9
- Retrieve multiple (paging) — Generator-based `get_multiple(...)` that yields pages, supports `$top` and Prefer: `odata.maxpagesize` (`page_size`).
@@ -16,6 +17,7 @@ A minimal Python SDK to use Microsoft Dataverse as a database for Azure AI Found
16
17
- SQL-over-API: T-SQL routed through Custom API endpoint (no ODBC / TDS driver required).
17
18
- Table metadata ops: create simple custom tables with primitive columns (string/int/decimal/float/datetime/bool) and delete them.
18
19
- Bulk create via `CreateMultiple` (collection-bound) by passing `list[dict]` to `create(entity_set, payloads)`; returns list of created IDs.
20
+
- Bulk update via `UpdateMultiple` by calling `update_multiple(entity_set, records)` with primary key attribute present in each record; returns nothing.
19
21
- Retrieve multiple with server-driven paging: `get_multiple(...)` yields lists (pages) following `@odata.nextLink`. Control total via `$top` and per-page via `page_size` (Prefer: `odata.maxpagesize`).
20
22
- Optional pandas integration (`PandasODataClient`) for DataFrame based create / get / query.
@@ -124,6 +133,29 @@ assert isinstance(ids, list) and all(isinstance(x, str) for x in ids)
124
133
print({"created_ids": ids})
125
134
```
126
135
136
+
## Bulk update (UpdateMultiple)
137
+
138
+
Use `update_multiple(entity_set, records)` for a transactional batch update. The method returns `None` regardless of service response; this avoids exposing inconsistent behavior across environments that may or may not emit updated IDs.
139
+
140
+
```python
141
+
ids = client.create("accounts", [
142
+
{"name": "Fourth Coffee"},
143
+
{"name": "Tailspin"},
144
+
])
145
+
146
+
client.update_multiple("accounts", [
147
+
{"accountid": ids[0], "telephone1": "555-1111"},
148
+
{"accountid": ids[1], "telephone1": "555-2222"},
149
+
])
150
+
print({"bulk_update": "ok"})
151
+
```
152
+
153
+
Notes:
154
+
- Each record must include the primary key attribute (e.g. `accountid`). No `id` alias yet.
155
+
- If any payload omits `@odata.type`, the logical name is resolved once and stamped (same as bulk create).
156
+
- Entire request fails (HTTP error) if any individual update fails; no partial success list is returned.
157
+
- If you need refreshed records post-update, issue individual `get` calls or a `get_multiple` query.
158
+
127
159
Notes:
128
160
- The bulk create response typically includes IDs only; the SDK returns the list of GUID strings.
129
161
- Single-record `create` still returns the full entity representation.
@@ -251,7 +283,7 @@ VS Code Tasks
251
283
252
284
## Limitations / Future Work
253
285
- No general-purpose OData batching, upsert, or association operations yet.
254
-
-`DeleteMultiple`/`UpdateMultiple` are not exposed; quickstart may demonstrate faster deletes using client-side concurrency only.
286
+
-`DeleteMultiple`not yet exposed; `UpdateMultiple` is available but returns no IDs (fire-and-forget semantics in this SDK version).
255
287
- Minimal retry policy in library (network-error only); examples include additional backoff for transient Dataverse consistency.
256
288
- Entity naming conventions in Dataverse: for multi-create the SDK resolves logical names from entity set metadata.
0 commit comments