v3.0.0-beta.90 (2024-08-22)
Features
Bug Fixes
Contributors
- Elliot DeNolf (@denolfe)
- Paul (@paulpopus)
Pre Release
Tag Name: v3.0.0-beta.90
Release Date: 8/22/2024
Payload CMSPayload CMS is a modern, self-hosted headless content management system built with TypeScript, Node.js, and MongoDB. It's designed specifically for developers who want full control over their content management system while maintaining a powerful admin interface for content editors.
This beta release adds a new @payloadcms/db-vercel-postgres adapter that optimizes Vercel Postgres integration with faster invocation times and no dependency on pg. It also fixes a UI error that occurred when displaying upload fields with has-many relationships that had no rows. These improvements enhance both database connectivity options and UI reliability for PayloadCMS users.
BasePostgresAdapter typeIf you're currently using Postgres with PayloadCMS on Vercel, you can migrate to the new adapter by following these steps:
Install the new adapter:
npm install @payloadcms/db-vercel-postgres
Update your PayloadCMS configuration:
import { buildConfig } from 'payload'
import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'
export default buildConfig({
db: vercelPostgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI, // Use your existing connection string
},
}),
// ...rest of your config
})
If you're using Vercel's environment variables (typically POSTGRES_URL), you can simplify to:
import { buildConfig } from 'payload'
import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'
export default buildConfig({
db: vercelPostgresAdapter(), // Automatic detection
// ...rest of your config
})
No database schema changes are required as this is only changing the connection adapter.
This beta release is recommended for:
As this is still a beta release (v3.0.0-beta.90), it's recommended to test thoroughly in a non-production environment before upgrading production systems. The Vercel Postgres adapter improvements are significant for Vercel users, but standard testing procedures for beta software should still be followed.
Fixed a UI error that occurred when displaying upload fields with has-many relationships that had no rows. This issue was causing interface problems when users were working with media relationships that didn't have any associated content. The fix ensures that the upload UI properly handles empty relationship states, providing a more stable experience for content editors working with media relationships.
A new dedicated adapter for Vercel Postgres has been added to PayloadCMS, offering several advantages:
@vercel/postgres package under the hood for native integrationpg dependency, resulting in faster invocation timesThe adapter can be implemented in two ways:
// With explicit connection string
import { buildConfig } from 'payload'
import { vercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'
export default buildConfig({
db: vercelPostgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI,
},
}),
// ...rest of config
})
// With automatic connection string detection
export default buildConfig({
db: postgresAdapter(),
// ...rest of config
})
Additionally, the release includes a refactoring of base Postgres functionality into a BasePostgresAdapter type, which will make it easier to implement other adapters supported by drizzle-orm in the future.
No security fixes were included in this release.
The new Vercel Postgres adapter offers performance improvements through:
pg dependency, resulting in faster invocation timesThese improvements are particularly beneficial for applications deployed on Vercel, as they reduce cold start times and improve overall database connectivity performance.
This release primarily impacts PayloadCMS users deploying on Vercel and those working with upload fields in has-many relationships. The new Vercel Postgres adapter provides a more optimized database connection experience with faster invocation times and simplified configuration. The UI fix resolves an error that affected content editors working with empty upload relationships.
The introduction of the BasePostgresAdapter type also lays groundwork for future database adapter implementations, which will benefit developers looking to use alternative PostgreSQL-compatible databases with PayloadCMS.
Overall, this release improves both developer experience through better database connectivity options and content editor experience through more reliable UI interactions.