Skip to content

Allow custom types to wrap selected column SQL#5754

Open
partyplatter08-lab wants to merge 1 commit into
drizzle-team:mainfrom
partyplatter08-lab:partyplatter08-lab/bounty-554
Open

Allow custom types to wrap selected column SQL#5754
partyplatter08-lab wants to merge 1 commit into
drizzle-team:mainfrom
partyplatter08-lab:partyplatter08-lab/bounty-554

Conversation

@partyplatter08-lab
Copy link
Copy Markdown

/claim #554

Summary

  • add selectFromDb(column) to customType params so custom columns can wrap their selected column SQL before driver decoding
  • apply the wrapper in select/returning SQL generation for PostgreSQL, MySQL, SQLite, SingleStore, and Gel custom columns, including relational JSON selection paths
  • document the new option and add SQL generation coverage for PostgreSQL, MySQL, and SQLite

Assumption

  • The public API name is selectFromDb, and it receives already-qualified column SQL where the dialect would normally emit the selected column.

Tests

  • corepack pnpm --dir drizzle-orm test -- custom-type-select.test.ts
  • corepack pnpm --dir drizzle-orm test:types
  • corepack pnpm lint
  • git diff --check
  • PATH="$PWD/.tmp-bin:$PATH" corepack pnpm --dir drizzle-orm build

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