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
Move relationship methods to client.tables namespace (#105)
* Move relationship methods to client.tables namespace
- Add create_one_to_many, create_many_to_many, delete_relationship,
get_relationship, and create_lookup_field to TableOperations
- Remove flat relationship methods from DataverseClient (not yet published)
- Update relationships example and README to use client.tables.*
- Update tests to use namespaced API
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update SDK usage SKILL with namespaced API and relationship examples
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: tpellissier <tpellissier@microsoft.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
description: Guidance for using the PowerPlatform Dataverse Client Python SDK. Use when calling the SDK like creating CRUD operations, SQL queries, table metadata management, and upload files.
3
+
description: Guidance for using the PowerPlatform Dataverse Client Python SDK. Use when calling the SDK like creating CRUD operations, SQL queries, table metadata management, relationships, and upload files.
4
4
---
5
5
6
6
# PowerPlatform Dataverse SDK Guide
@@ -17,6 +17,11 @@ Use the PowerPlatform Dataverse Client Python SDK to interact with Microsoft Dat
17
17
- Custom columns: include customization prefix (e.g., `"new_Price"`, `"cr123_Status"`)
18
18
- ALWAYS use **schema names** (logical names), NOT display names
19
19
20
+
### Operation Namespaces
21
+
-`client.records` -- CRUD and OData queries
22
+
-`client.query` -- query and search operations
23
+
-`client.tables` -- table metadata, columns, and relationships
24
+
20
25
### Bulk Operations
21
26
The SDK supports Dataverse's native bulk operations: Pass lists to `create()`, `update()` for automatic bulk processing, for `delete()`, set `use_bulk_delete` when passing lists to use bulk operation
22
27
@@ -29,7 +34,7 @@ The SDK supports Dataverse's native bulk operations: Pass lists to `create()`, `
SQL queries are **read-only** and support limited SQL syntax. A single SELECT statement with optional WHERE, TOP (integer literal), ORDER BY (column names only), and a simple table alias after FROM is supported. But JOIN and subqueries may not be. Refer to the Dataverse documentation for the current feature set.
120
122
121
123
```python
122
-
# Basic SQL query
123
-
results = client.query_sql(
124
+
results = client.query.sql(
124
125
"SELECT TOP 10 accountid, name FROM account WHERE statecode = 0"
125
126
)
126
127
for record in results:
@@ -132,22 +133,22 @@ for record in results:
132
133
#### Create Custom Tables
133
134
```python
134
135
# Create table with columns (include customization prefix!)
135
-
table_info = client.create_table(
136
-
table_schema_name="new_Product",
137
-
columns={
136
+
table_info = client.tables.create(
137
+
"new_Product",
138
+
{
138
139
"new_Code": "string",
139
140
"new_Price": "decimal",
140
141
"new_Active": "bool",
141
-
"new_Quantity": "int"
142
-
}
142
+
"new_Quantity": "int",
143
+
},
143
144
)
144
145
145
146
# With solution assignment and custom primary column
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ The SDK provides a simple, pythonic interface for Dataverse operations:
112
112
| Concept | Description |
113
113
|---------|-------------|
114
114
|**DataverseClient**| Main entry point; provides `records`, `query`, and `tables` namespaces |
115
-
|**Namespaces**| Operations are organized into `client.records` (CRUD), `client.query` (queries), and `client.tables` (metadata) |
115
+
|**Namespaces**| Operations are organized into `client.records` (CRUD), `client.query` (queries), and `client.tables` (metadata & relationships) |
116
116
|**Records**| Dataverse records represented as Python dictionaries with column schema names |
117
117
|**Schema names**| Use table schema names (`"account"`, `"new_MyTestTable"`) and column schema names (`"name"`, `"new_MyTestColumn"`). See: [Table definitions in Microsoft Dataverse](https://learn.microsoft.com/en-us/power-apps/developer/data-platform/entity-metadata)|
118
118
|**Bulk Operations**| Efficient bulk processing for multiple records with automatic optimization |
0 commit comments