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
- Bulk update — Call `update_multiple(entity_set, records)` to invoke the bound `UpdateMultiple` action; returns nothing. Each record must include the real primary key attribute (e.g. `accountid`).
@@ -14,7 +14,7 @@ A minimal Python SDK to use Microsoft Dataverse as a database for Azure AI Found
14
14
## Features
15
15
16
16
- Simple `DataverseClient` facade for CRUD, SQL (read-only), and table metadata.
17
-
- SQL-over-API: T-SQL routed through Custom API endpoint (no ODBC / TDS driver required).
17
+
- SQL-over-API: Constrained SQL (single SELECT with limited WHERE/TOP/ORDER BY) via native Web API `?sql=` parameter.
18
18
- Table metadata ops: create simple custom tables with primitive columns (string/int/decimal/float/datetime/bool) and delete them.
19
19
- Bulk create via `CreateMultiple` (collection-bound) by passing `list[dict]` to `create(entity_set, payloads)`; returns list of created IDs.
20
20
- Bulk update via `UpdateMultiple` by calling `update_multiple(entity_set, records)` with primary key attribute present in each record; returns nothing.
@@ -35,12 +35,12 @@ Create and activate a Python 3.13+ environment, then install dependencies:
35
35
python -m pip install -r requirements.txt
36
36
```
37
37
38
-
Direct TDS via ODBC is not used; SQL reads are executed via the Custom API over OData.
38
+
Direct TDS via ODBC is not used; SQL reads are executed via the Web API using the `?sql=` query parameter.
39
39
40
40
## Configuration Notes
41
41
42
42
- 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.
43
-
- For complete functionalities, please use one of the PREPROD BAP environments, otherwise McpExecuteSqlQuery might not work.
43
+
(Preprod environments may surface newest SQL subset capabilities sooner than production.)
44
44
45
45
### Configuration (DataverseConfig)
46
46
@@ -50,7 +50,7 @@ Pass a `DataverseConfig` or rely on sane defaults:
- Creating, reading, updating, and deleting records (OData)
71
71
- Bulk create (CreateMultiple) to insert many records in one call
72
72
- Retrieve multiple with paging (contrasting `$top` vs `page_size`)
73
-
- Executing a read-only SQL query
73
+
- Executing a read-only SQL query (Web API `?sql=`)
74
74
75
75
## Examples
76
76
@@ -112,7 +112,7 @@ print({"bulk_update": "ok"})
112
112
# Delete
113
113
client.delete("accounts", account_id)
114
114
115
-
# SQL (read-only) via Custom API
115
+
# SQL (read-only) via Web API `?sql=`
116
116
rows = client.query_sql("SELECT TOP 3 accountid, name FROM account ORDER BY createdon DESC")
117
117
for r in rows:
118
118
print(r.get("accountid"), r.get("name"))
@@ -271,7 +271,7 @@ Notes:
271
271
- Passing a list of payloads to `create` triggers bulk create and returns `list[str]` of IDs.
272
272
- Use `get_multiple` for paging through result sets; prefer `select` to limit columns.
273
273
- For CRUD methods that take a record id, pass the GUID string (36-char hyphenated). Parentheses around the GUID are accepted but not required.
274
-
- SQL is routed through the Custom API named in `DataverseConfig.sql_api_name` (default: `McpExecuteSqlQuery`).
274
+
* 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