Skip to content

add direct get and all calls#6

Merged
Smef merged 1 commit into
mainfrom
direct-get-all
May 14, 2026
Merged

add direct get and all calls#6
Smef merged 1 commit into
mainfrom
direct-get-all

Conversation

@Smef
Copy link
Copy Markdown
Owner

@Smef Smef commented May 14, 2026

Add direct get() and all() function calls to models

Summary by CodeRabbit

Release Notes

  • New Features

    • Added simplified model retrieval methods: use Model.all() or Model.get() for cleaner syntax when fetching all records.
  • Documentation

    • Updated model retrieval documentation to reflect the new simplified API patterns.

Review Change Stack

Copilot AI review requested due to automatic review settings May 14, 2026 18:01
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 204ab895-6380-48e1-9ca9-c342b4a59760

📥 Commits

Reviewing files that changed from the base of the PR and between 290b2ba and 783f199.

📒 Files selected for processing (3)
  • docs/content/2.models/2.retrieving.md
  • src/model/StaticForwarder.ts
  • test/tests/Base.ts

📝 Walkthrough

Walkthrough

This PR adds two convenience methods (get() and all()) to the StaticForwarder class for simpler model retrieval, complete with test validation and updated documentation reflecting the new recommended API.

Changes

Convenience methods for retrieving all models

Layer / File(s) Summary
StaticForwarder get and all methods
src/model/StaticForwarder.ts
New get() and all() static async methods delegate to query().get() and return Promise<InstanceType<T>[]> for direct model class retrieval.
Model retrieval test suite
test/tests/Base.ts
Test suite verifies Pet.get() and Pet.all() return all records with full attributes, validates TypeScript type narrowing for select(...).get(), and confirms sort order preservation with orderBy(...).get().
Retrieving all models documentation
docs/content/2.models/2.retrieving.md
Documentation updated to show the new simplified API: const users = await User.all(); instead of User.query().get().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A rabbit hops through the meadow green,
Dancing with methods never before seen!
get() and all() now shine so bright,
Retrieving models feels oh so right! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly describes the main change: adding direct get() and all() method calls to models.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch direct-get-all

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Smef Smef merged commit d77c400 into main May 14, 2026
4 of 6 checks passed
@Smef Smef deleted the direct-get-all branch May 14, 2026 18:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds direct model-level retrieval helpers so callers can fetch all records with Model.get() or Model.all() instead of explicitly starting from Model.query().

Changes:

  • Added StaticForwarder.get() and StaticForwarder.all() as direct forwarding methods to query().get().
  • Added tests covering direct retrieval, return typing, and continued builder chaining with get().
  • Updated retrieving-models documentation to mention direct class-level all/get usage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/model/StaticForwarder.ts Adds static get() and all() forwarding methods.
test/tests/Base.ts Adds coverage for direct model retrieval and type expectations.
docs/content/2.models/2.retrieving.md Updates docs to show direct retrieval via User.all().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants