Skip to content

Add createAll for multiple entities - #335

Open
elpete wants to merge 1 commit into
nextfrom
feat/62-create-all
Open

Add createAll for multiple entities#335
elpete wants to merge 1 commit into
nextfrom
feat/62-create-all

Conversation

@elpete

@elpete elpete commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #62

Issue review

Recommendation: 8/10 — implement. createAll is a natural companion to create when callers need saved entity instances back. It keeps generated keys, casts, timestamps, custom collections, and lifecycle events intact. The tradeoff is deliberate: unlike qb’s bulk insert, this executes one insert per entity, so callers prioritizing throughput over entity behavior should continue using qb insert/upsert operations.

Implementation

  • adds BaseEntity.createAll(attributes, ignoreNonExistentAttributes, options)
  • creates every item through Quick’s normal public create and save flow
  • returns the model’s configured collection type via newCollection
  • returns loaded entities with generated primary keys

Test-first evidence

The public API regression initially errored with QuickMissingMethod because createAll did not exist. It now creates two records, returns both loaded entities, and verifies persistence through a separate Quick query.

Validation

  • focused CreateSpec: 4 passed, 0 failed, 0 errors
  • full Lucee 6 suite: 496 passed, 0 failed, 0 errors, 3 skipped
  • box run-script format
  • git diff --check

Uses qb@14.0.0-beta.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant