Skip to content

feat(db-postgres,db-sqlite,db-vercel-postgres,db-d1-sqlite,drizzle)!: remove /types subpath exports#16629

Merged
paulpopus merged 5 commits into
mainfrom
chore/drizzle-move-types-from-/types-to-root-export
May 18, 2026
Merged

feat(db-postgres,db-sqlite,db-vercel-postgres,db-d1-sqlite,drizzle)!: remove /types subpath exports#16629
paulpopus merged 5 commits into
mainfrom
chore/drizzle-move-types-from-/types-to-root-export

Conversation

@paulpopus
Copy link
Copy Markdown
Contributor

Summary

  • Removes the deprecated /types subpath export from @payloadcms/drizzle, @payloadcms/db-postgres, @payloadcms/db-sqlite, @payloadcms/db-vercel-postgres, and @payloadcms/db-d1-sqlite. All types are available from the main package entry point.
  • Migrates all internal imports (DrizzleAdapter, BuildQueryJoinAliases, PostgresAdapter, SQLiteAdapter) from the /types subpath to the main package.
  • Adds the migrate-db-types-subpath codemod transform to @payloadcms/codemod to auto-migrate user projects.
  • Documents the breaking change in the 3.0→4.0 migration guide.

Breaking Changes

@payloadcms/drizzle/types@payloadcms/drizzle

- import type { DrizzleAdapter, BuildQueryJoinAliases } from '@payloadcms/drizzle/types'
+ import type { DrizzleAdapter, BuildQueryJoinAliases } from '@payloadcms/drizzle'

@payloadcms/db-postgres/types@payloadcms/db-postgres

- import type { PostgresAdapter, GeneratedDatabaseSchema } from '@payloadcms/db-postgres/types'
+ import type { PostgresAdapter, GeneratedDatabaseSchema } from '@payloadcms/db-postgres'

@payloadcms/db-sqlite/types@payloadcms/db-sqlite

- import type { SQLiteAdapter, SQLiteSchemaHook } from '@payloadcms/db-sqlite/types'
+ import type { SQLiteAdapter, SQLiteSchemaHook } from '@payloadcms/db-sqlite'

@payloadcms/db-vercel-postgres/types@payloadcms/db-vercel-postgres

- import type { VercelPostgresAdapter } from '@payloadcms/db-vercel-postgres/types'
+ import type { VercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'

@payloadcms/db-d1-sqlite/types@payloadcms/db-d1-sqlite

- import type { SQLiteD1Adapter } from '@payloadcms/db-d1-sqlite/types'
+ import type { SQLiteD1Adapter } from '@payloadcms/db-d1-sqlite'

declare module augmentations

Generated schema files that augment GeneratedDatabaseSchema must also update the module path:

- declare module '@payloadcms/db-postgres/types' {
+ declare module '@payloadcms/db-postgres' {
    export interface GeneratedDatabaseSchema {
      schema: DatabaseSchema
    }
  }

Migration

Run the codemod to migrate automatically:

npx @payloadcms/codemod --transform migrate-db-types-subpath

The codemod handles import declarations, re-export declarations, and declare module augmentations. It is idempotent and safe to run on partially-migrated projects.

@github-actions
Copy link
Copy Markdown
Contributor

📦 esbuild Bundle Analysis for payload

This analysis was generated by esbuild-bundle-analyzer. 🤖
This PR introduced no changes to the esbuild bundle! 🙌

@paulpopus paulpopus merged commit 03f81ae into main May 18, 2026
323 of 326 checks passed
@paulpopus paulpopus deleted the chore/drizzle-move-types-from-/types-to-root-export branch May 18, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants