Skip to content

fix: add hono adapter Database type override#100

Merged
mandarini merged 1 commit into
supabase:mainfrom
elGatoMantocko:elliott/fix-hono-adapter-types
Jul 22, 2026
Merged

fix: add hono adapter Database type override#100
mandarini merged 1 commit into
supabase:mainfrom
elGatoMantocko:elliott/fix-hono-adapter-types

Conversation

@elGatoMantocko

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Fix hono adapter type definitions.

What is the current behavior?

There is no way to override the DB context returned by the withSupabase middleware without doing so in the Hono app itself.

What is the new behavior?

Make the hono withSupabase adapter more type-aware. Allow Database type overrides in the hono middleware.

Additional context

For growing projects, managing routes with hono's route helpers via sub-applications generally becomes best practice when scalaing a hono api. In those scenarios, it's common to see many hono "apps" or routes defined across a stack. This change allows users to just use the hono middleware without needing to pre-declare any context types.

adds generic Database type override to hono adapter
added test to ensure chained declarations preserve context type
updated docs to include alternative hono declaration
@elGatoMantocko
elGatoMantocko requested review from a team as code owners July 8, 2026 18:35
@elGatoMantocko elGatoMantocko changed the title fix: add hono adapter Database type override fix(#101): add hono adapter Database type override Jul 8, 2026
@elGatoMantocko

Copy link
Copy Markdown
Contributor Author

fixes #101

@pkg-pr-new

pkg-pr-new Bot commented Jul 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@supabase/server@100

commit: 5fb279c

@mandarini mandarini changed the title fix(#101): add hono adapter Database type override fix: add hono adapter Database type override Jul 22, 2026
@mandarini mandarini linked an issue Jul 22, 2026 that may be closed by this pull request
2 tasks
@mandarini
mandarini merged commit ca53801 into supabase:main Jul 22, 2026
3 checks passed
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.

hono adapter type override improvment

2 participants