Skip to content

fix: correct table name from 'patients' to 'patient' in getTherapistPatients#166

Open
Varadraj75 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Varadraj75:fix/therapist-patients-table-name
Open

fix: correct table name from 'patients' to 'patient' in getTherapistPatients#166
Varadraj75 wants to merge 1 commit intoAOSSIE-Org:mainfrom
Varadraj75:fix/therapist-patients-table-name

Conversation

@Varadraj75
Copy link
Contributor

@Varadraj75 Varadraj75 commented Feb 27, 2026

Closes #165

📝 Description

getTherapistPatients was querying a non-existent table patients instead
of the correct table patient (singular), causing the function to always
fail with a Supabase relation "patients" does not exist error.

🔧 Changes Made

  • therapist/lib/repository/supabase_therapist_repository.dart: Changed
    .from('patients').from('patient') on line 70

📷 Screenshots or Visual Changes (if applicable)

N/A — one character typo fix, no visual changes.

🤝 Collaboration

Collaborated with: N/A

✅ Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if applicable).
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the database table reference for retrieving therapist patient records, ensuring data is fetched from the correct source.

Copilot AI review requested due to automatic review settings February 27, 2026 11:31
@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7a6d17 and 51e5ebb.

📒 Files selected for processing (1)
  • therapist/lib/repository/supabase_therapist_repository.dart

📝 Walkthrough

Walkthrough

A bug fix that corrects the database table name in the getTherapistPatients method from 'patients' (plural) to 'patient' (singular), aligning with the actual database schema and enabling the function to execute successfully.

Changes

Cohort / File(s) Summary
Database Table Reference Fix
therapist/lib/repository/supabase_therapist_repository.dart
Corrected Supabase table reference from non-existent 'patients' to correct 'patient' in getTherapistPatients query.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A table was lost in the plural past,
Where 'patients' grew sparse and queries would crash,
But now singular 'patient' lights up the way,
The therapist's data flows bright as the day!
hop hop

🚥 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 title accurately describes the main change: correcting the table name from 'patients' to 'patient' in the getTherapistPatients method, which is the sole modification in this changeset.
Linked Issues check ✅ Passed The pull request fully satisfies issue #165 by implementing the exact suggested fix: changing .from('patients') to .from('patient') at line 70 in supabase_therapist_repository.dart.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing issue #165; only the table name reference was modified with no unrelated alterations to code, UI, tests, or documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

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

This PR fixes a critical bug where getTherapistPatients() was querying a non-existent table named 'patients' instead of the correct singular table name 'patient'. This caused all calls to this function to fail with a Supabase "relation does not exist" error. The fix aligns the code with the established database schema naming convention used throughout the codebase.

Changes:

  • Corrected table name from 'patients' (plural) to 'patient' (singular) in the getTherapistPatients() function

💡 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.

BUG: getTherapistPatients queries non-existent table 'patients' — should be 'patient'

2 participants