Skip to content

fix(rivetkit): export database provider types#4950

Merged
NathanFlurry merged 1 commit intomainfrom
rivetkit-db/export-provider-types
May 5, 2026
Merged

fix(rivetkit): export database provider types#4950
NathanFlurry merged 1 commit intomainfrom
rivetkit-db/export-provider-types

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 4, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 4, 2026

PR Review: fix(rivetkit): export database provider types

Overview

This PR fixes a missing type export: AnyDatabaseProvider was defined in src/common/database/config.ts but was never re-exported through src/db/mod.ts, making it inaccessible to users importing from rivetkit/db. The fix is minimal and correct.


Code Quality

src/db/mod.ts — Adding AnyDatabaseProvider to the export list is the right fix. All other types from config.ts are already exported here; this was simply an omission.

tests/package-surface.test.ts — Follows the existing compile-time surface test pattern established by RestoredContextTypeSmoke. The RestoredDatabaseSurfaceTypes | null = null idiom is a pure TypeScript type check that will fail to compile if any imported type is missing or broken. This is the correct pattern for this test file.


Observations

  • AnyDatabaseProvider = DatabaseProvider<any> | undefined — the | undefined branch represents an actor with no database configured, which makes this useful as a constraint in generic actor/framework utility types. The use of any here is intentional and appropriate for a "wildcard" type alias.
  • The three types imported in the new surface test (AnyDatabaseProvider, DatabaseProvider, RawAccess) were all importable from source already — only the public package surface was broken for AnyDatabaseProvider.

Minor Consideration

InferDatabaseClient<T> (also in config.ts) is the natural companion to AnyDatabaseProvider — it extracts the resolved client type from a provider. Any user who stores an AnyDatabaseProvider and later needs to type the resolved client would reach for this utility type. It is currently absent from db/mod.ts. Worth considering whether it belongs in the same export list, or whether it's intentionally kept internal.


Summary

Clean, focused fix for a missing export. Test coverage is correctly added using the existing surface-test pattern. No correctness, performance, or security concerns.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Preview packages published to npm

Install with:

npm install rivetkit@pr-4950

All packages published as 0.0.0-pr.4950.9f55515 with tag pr-4950.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-9f55515
docker pull rivetdev/engine:full-9f55515
Individual packages
npm install rivetkit@pr-4950
npm install @rivetkit/react@pr-4950
npm install @rivetkit/rivetkit-napi@pr-4950
npm install @rivetkit/workflow-engine@pr-4950

@NathanFlurry NathanFlurry marked this pull request as ready for review May 5, 2026 11:24
Base automatically changed from 05-04-wip_kitchen_sink_agentic_loop_finish to main May 5, 2026 14:58
@NathanFlurry NathanFlurry merged commit 63a3fd9 into main May 5, 2026
24 of 28 checks passed
@NathanFlurry NathanFlurry deleted the rivetkit-db/export-provider-types branch May 5, 2026 14:58
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