Skip to content

Commit e8fac2e

Browse files
author
Max Wang
committed
clean up & fix some minor issues
1 parent 185d989 commit e8fac2e

5 files changed

Lines changed: 392 additions & 187 deletions

File tree

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A minimal Python SDK to use Microsoft Dataverse as a database for Azure AI Found
1515

1616
- Simple `DataverseClient` facade for CRUD, SQL (read-only), and table metadata.
1717
- SQL-over-API: Constrained SQL (single SELECT with limited WHERE/TOP/ORDER BY) via native Web API `?sql=` parameter.
18-
- Table metadata ops: create simple custom tables with primitive columns (string/int/decimal/float/datetime/bool) and delete them.
18+
- Table metadata ops: create simple custom tables (supports string/int/decimal/float/datetime/bool/optionset) and delete them.
1919
- Bulk create via `CreateMultiple` (collection-bound) by passing `list[dict]` to `create(entity_set, payloads)`; returns list of created IDs.
2020
- Bulk update via `UpdateMultiple` (invoked internally) by calling unified `update(entity_set, ids, patch|patches)`; returns nothing.
2121
- 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`).
@@ -272,7 +272,25 @@ for page in pages: # page is list[dict]
272272
### Custom table (metadata) example
273273

274274
```python
275-
# Create a simple custom table and a few primitive columns
275+
# Support multi-lingual enums
276+
class Status(IntEnum):
277+
Active = 1
278+
Inactive = 2
279+
Archived = 5
280+
__labels__ = {
281+
1033: {
282+
"Active": "Active",
283+
"Inactive": "Inactive",
284+
"Archived": "Archived",
285+
},
286+
1036: {
287+
"Active": "Actif",
288+
"Inactive": "Inactif",
289+
"Archived": "Archivé",
290+
}
291+
}
292+
293+
# Create a simple custom table and a few columns
276294
info = client.create_table(
277295
"SampleItem", # friendly name; defaults to SchemaName new_SampleItem
278296
{
@@ -281,6 +299,7 @@ info = client.create_table(
281299
"amount": "decimal",
282300
"when": "datetime",
283301
"active": "bool",
302+
"status": Status,
284303
},
285304
)
286305

0 commit comments

Comments
 (0)