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
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
A minimal Python SDK to use Microsoft Dataverse as a database for Azure AI Foundry–style apps.
4
4
5
-
- Read (SQL) — Execute read-only T‑SQL via the McpExecuteSqlQuery Custom API. Returns `list[dict]`.
5
+
- Read (SQL) — Execute constrained read-only SQL via the Dataverse Web API`?sql=` parameter. 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
8
- Retrieve multiple (paging) — Generator-based `get_multiple(...)` that yields pages, supports `$top` and Prefer: `odata.maxpagesize` (`page_size`).
@@ -13,7 +13,7 @@ A minimal Python SDK to use Microsoft Dataverse as a database for Azure AI Found
13
13
## Features
14
14
15
15
- Simple `DataverseClient` facade for CRUD, SQL (read-only), and table metadata.
16
-
- SQL-over-API: T-SQL routed through Custom API endpoint (no ODBC / TDS driver required).
16
+
- SQL-over-API: Constrained T-SQL (single SELECT with limited WHERE/TOP/ORDER BY) via native Web API `?sql=` parameter.
17
17
- Table metadata ops: create simple custom tables with primitive columns (string/int/decimal/float/datetime/bool) and delete them.
18
18
- Bulk create via `CreateMultiple` (collection-bound) by passing `list[dict]` to `create(entity_set, payloads)`; returns list of created IDs.
19
19
- 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`).
@@ -33,12 +33,12 @@ Create and activate a Python 3.13+ environment, then install dependencies:
33
33
python -m pip install -r requirements.txt
34
34
```
35
35
36
-
Direct TDS via ODBC is not used; SQL reads are executed via the Custom API over OData.
36
+
Direct TDS via ODBC is not used; SQL reads are executed via the Web API using the `?sql=` query parameter.
37
37
38
38
## Configuration Notes
39
39
40
40
- For Web API (OData), tokens target your Dataverse org URL scope: https://yourorg.crm.dynamics.com/.default. The SDK requests this scope from the provided TokenCredential.
41
-
- For complete functionalities, please use one of the PREPROD BAP environments, otherwise McpExecuteSqlQuery might not work.
41
+
(Preprod environments may surface newest SQL subset capabilities sooner than production.)
42
42
43
43
### Configuration (DataverseConfig)
44
44
@@ -48,7 +48,7 @@ Pass a `DataverseConfig` or rely on sane defaults:
rows = client.query_sql("SELECT TOP 3 accountid, name FROM account ORDER BY createdon DESC")
108
108
for r in rows:
109
109
print(r.get("accountid"), r.get("name"))
@@ -239,7 +239,7 @@ Notes:
239
239
- Passing a list of payloads to `create` triggers bulk create and returns `list[str]` of IDs.
240
240
- Use `get_multiple` for paging through result sets; prefer `select` to limit columns.
241
241
- For CRUD methods that take a record id, pass the GUID string (36-char hyphenated). Parentheses around the GUID are accepted but not required.
242
-
- SQL is routed through the Custom API named in `DataverseConfig.sql_api_name` (default: `McpExecuteSqlQuery`).
242
+
* SQL queries are executed directly against entity set endpoints using the `?sql=` parameter. Supported subset only (single SELECT, optional WHERE/TOP/ORDER BY, alias). Unsupported constructs will be rejected by the service.
0 commit comments