Skip to content

Bulk create (CreateMultiple), paged retrieves, README/quickstart updates - #6

Merged
tpellissier-msft merged 1 commit into
mainfrom
user/tpellissier/bulkops
Sep 9, 2025
Merged

tpellissier-msft merged 1 commit into
mainfrom
user/tpellissier/bulkops

Conversation

@tpellissier-msft

Copy link
Copy Markdown
Contributor
  • Support bulk create, calling CreateMultiple API
  • Support bulk retrieve, accepting standard API GET params ($select, $top, $filter, $orderby) in OData format and yielding paged results
  • README updates
  • quickstart updates (incorporating above changes, plus adding optional table deletion for quicker runs and optional keyboard-waits for better demo-ability)

Copilot summary:

Bulk operations and paging support:

  • Added support for bulk record creation: Passing a list of payloads to create invokes the CreateMultiple action, returning a list of GUIDs for created records. This is reflected in both the SDK (DataverseClient.create) and documentation. [1] [2] [3] [4] [5] [6]
  • Implemented get_multiple for paged retrieval: New DataverseClient.get_multiple method yields pages of records, supporting $top and page_size for server-driven paging. Examples and documentation illustrate usage and semantics. [1] [2] [3] [4] [5] [6]

Quickstart script improvements:

  • Updated quickstart to demonstrate bulk create, paged retrieval, and concurrent deletes: The script now shows single and bulk record creation, runs multiple paging demos, and deletes records concurrently with error handling and summary reporting. [1] [2] [3]
  • Added interactive options for pausing between steps and cleaning up the test table: Users can control whether to pause between steps and whether to delete the custom table at the end. [1] [2] [3]

Documentation updates:

  • Expanded README to describe new bulk and paging features, including usage notes, parameter explanations, and limitations. Clarified that general-purpose batching and multi-record update/delete are not yet supported. [1] [2] [3] [4] [5] [6]
@tpellissier-msft
tpellissier-msft merged commit c7b16a6 into main Sep 9, 2025

# ----------------------------- CRUD ---------------------------------
def create(self, entity_set: str, data: Dict[str, Any]) -> Dict[str, Any]:
def create(self, entity_set: str, data: Union[Dict[str, Any], List[Dict[str, Any]]]) -> Union[Dict[str, Any], List[str]]:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another thing that is in Jeff's pr is he added return_ids_only: bool = False parameter to the call. and returning ids only is closer to what web api does https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/xrm-webapi/createrecord. do we want to add it? and if we do which should be the default behavior?

ids = body.get("Ids")
if isinstance(ids, list):
return [i for i in ids if isinstance(i, str)]
# Future-proof: some environments might eventually return value/list of entities.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know if this is the case?

orderby: Optional[List[str]] = None,
top: Optional[int] = None,
expand: Optional[List[str]] = None,
page_size: Optional[int] = None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in parameters description

ps = int(page_size)
if ps > 0:
headers["Prefer"] = f"odata.maxpagesize={ps}"
except Exception:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to allow silent exception here?

@zhaodongwang-msft
zhaodongwang-msft deleted the user/tpellissier/bulkops branch February 13, 2026 21:52
tpellissier-msft pushed a commit that referenced this pull request Feb 18, 2026
- Document type aliases in tables.create() columns param (#4)
- Clarify SQL description in client namespace summary (#8)
- Add :raises: for HttpError, ValidationError, ValueError across all
  operation methods (#6)
- Fix query.sql() to document ValidationError instead of incorrect
  SQLParseError
- Restore post-call validation in records.create() matching original
  client.create() behavior (#9)
- Improve deprecated get() docstring with explicit guidance on when to
  use records.get() vs query.get() (#10)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tpellissier-msft pushed a commit that referenced this pull request Feb 18, 2026
- Document type aliases in tables.create() columns param (#4)
- Clarify SQL description in client namespace summary (#8)
- Add :raises: for HttpError, ValidationError, ValueError across all
  operation methods (#6)
- Fix query.sql() to document ValidationError instead of incorrect
  SQLParseError
- Restore post-call validation in records.create() matching original
  client.create() behavior (#9)
- Improve deprecated get() docstring with explicit guidance on when to
  use records.get() vs query.get() (#10)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tpellissier-msft pushed a commit that referenced this pull request Feb 18, 2026
- Document type aliases in tables.create() columns param (#4)
- Clarify SQL description in client namespace summary (#8)
- Add :raises: for HttpError, ValidationError, ValueError across all
  operation methods (#6)
- Fix query.sql() to document ValidationError instead of incorrect
  SQLParseError
- Restore post-call validation in records.create() matching original
  client.create() behavior (#9)
- Improve deprecated get() docstring with explicit guidance on when to
  use records.get() vs query.get() (#10)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tpellissier-msft added a commit that referenced this pull request Feb 19, 2026
#102)

* Add operation namespaces (client.records, client.query, client.tables)

Reorganize SDK public API into three operation namespaces per the SDK
Redesign Summary. New namespace methods use cleaner signatures (keyword-only
params, @overload for single/bulk, renamed table params) while all existing
flat methods (client.create, client.get, etc.) continue to work unchanged
with deprecation warnings that point to the new equivalents.

Key changes:
- records.create() returns str for single, list[str] for bulk
- query.get() handles paginated multi-record queries
- tables.create() uses solution= and primary_column= keyword args
- 40 new unit tests (75 total, all passing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Fix PR review comments: docstrings, error docs, and create() validation

- Document type aliases in tables.create() columns param (#4)
- Clarify SQL description in client namespace summary (#8)
- Add :raises: for HttpError, ValidationError, ValueError across all
  operation methods (#6)
- Fix query.sql() to document ValidationError instead of incorrect
  SQLParseError
- Restore post-call validation in records.create() matching original
  client.create() behavior (#9)
- Improve deprecated get() docstring with explicit guidance on when to
  use records.get() vs query.get() (#10)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Use :class: role in :type:/:rtype: directives for Sphinx cross-references

Aligns with existing codebase convention and ensures clickable
hyperlinks in generated API documentation.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants