Skip to content

feat(orm): allow customType selectFromDb SQL transforms#5796

Open
TheDerbiedOne wants to merge 1 commit into
drizzle-team:mainfrom
TheDerbiedOne:feat/bounty-1083-customtype-selectfromdb
Open

feat(orm): allow customType selectFromDb SQL transforms#5796
TheDerbiedOne wants to merge 1 commit into
drizzle-team:mainfrom
TheDerbiedOne:feat/bounty-1083-customtype-selectfromdb

Conversation

@TheDerbiedOne
Copy link
Copy Markdown

@TheDerbiedOne TheDerbiedOne commented May 22, 2026

Addresses #1083.

Summary

This PR adds a new optional selectFromDb hook to customType(...), allowing custom columns to customize how they are selected from the database before driver decoding.

This is useful for custom types that require SQL-level transformation when selected, such as PostGIS geometries.

Changes

  • Adds selectFromDb to custom type params across supported dialects.
  • Uses selectFromDb during select query generation.
  • Adds a test covering custom select SQL generation.
  • Updates custom type documentation.

Verification

Ran:

npx -y pnpm@10.6.3 -C drizzle-orm test -- --run customTypeSelectFromDb

@TheDerbiedOne TheDerbiedOne changed the title feat: customType selectFromDb feat(orm): allow customType selectFromDb SQL transforms May 22, 2026
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