Skip to content

fix: typecheck for sql decoder#215

Closed
arashsheyda wants to merge 1 commit into
unjs:mainfrom
arashsheyda:fix/sql-typecheck
Closed

fix: typecheck for sql decoder#215
arashsheyda wants to merge 1 commit into
unjs:mainfrom
arashsheyda:fix/sql-typecheck

Conversation

@arashsheyda

@arashsheyda arashsheyda commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

small PR to fix #214

you can see an example failure on this run

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to

Summary by CodeRabbit

  • Bug Fixes
    • Fixed decoder extraction logic for aliased database fields to ensure correct data type handling and preserve backward compatibility.

@coderabbitai

coderabbitai Bot commented Mar 12, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The mapResultRow function's decoder extraction logic was refactored in its else branch. Previously checking field.sql directly, the code now destructures sql from field as SQL.Aliased and performs a "decoder" in sql check before accessing the decoder. This improves type alignment for aliased fields while preserving existing behavior.

Changes

Cohort / File(s) Summary
Decoder Extraction Refinement
src/integrations/drizzle/_utils.ts
Modified decoder extraction logic in mapResultRow to destructure and properly check aliased SQL fields before accessing decoder property.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A decoder's dance, now precisely aligned,
From aliased fields, the right path we find,
With checks in place and destructuring grace,
The logic runs smoother, in its rightful place! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing a typecheck for SQL decoder extraction in the mapResultRow function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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.

@arashsheyda

Copy link
Copy Markdown
Contributor Author

closing this as #219 has fixed the issue 🚀

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.

failing pnpm test:types

1 participant