Home

>

Tools

>

Payload CMS

>

Releases

>

3.0.0-beta.90

Payload CMS Release: 3.0.0-beta.90

Pre Release

Tag Name: v3.0.0-beta.90

Release Date: 8/22/2024

Payload CMS LogoPayload CMS

Payload 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.

TL;DR

PayloadCMS v3.0.0-beta.90 introduces a dedicated Vercel Postgres adapter and fixes an upload UI bug

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.

Highlight of the Release

    • New dedicated Vercel Postgres adapter with optimized performance
    • Fixed UI error in upload fields with has-many relationships
    • Automatic connection string detection for Vercel environments
    • Refactored base Postgres functionality into a BasePostgresAdapter type

Migration Guide

Migrating to the Vercel Postgres Adapter

If you're currently using Postgres with PayloadCMS on Vercel, you can migrate to the new adapter by following these steps:

  1. Install the new adapter:

    npm install @payloadcms/db-vercel-postgres
    
  2. 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
    })
    
  3. 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.

Upgrade Recommendations

This beta release is recommended for:

  • Developers using PayloadCMS with Vercel Postgres who want improved performance
  • Users who have experienced issues with upload fields in has-many relationships
  • Anyone looking to simplify their Vercel deployment configuration

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.

Bug Fixes

Upload Has-Many No Rows Error

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.

New Features

@payloadcms/db-vercel-postgres Adapter

A new dedicated adapter for Vercel Postgres has been added to PayloadCMS, offering several advantages:

  • Uses the @vercel/postgres package under the hood for native integration
  • Eliminates the pg dependency, resulting in faster invocation times
  • Includes automatic connection string detection from Vercel environment variables
  • Simplifies configuration with minimal setup required

The 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.

Security Updates

No security fixes were included in this release.

Performance Improvements

Vercel Postgres Adapter Performance

The new Vercel Postgres adapter offers performance improvements through:

  • Removal of the pg dependency, resulting in faster invocation times
  • Direct integration with Vercel's native database services
  • Optimized connection handling specific to the Vercel environment

These improvements are particularly beneficial for applications deployed on Vercel, as they reduce cold start times and improve overall database connectivity performance.

Impact Summary

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.

Full Release Notes

Statistics:

File Changed68
Line Additions1,726
Line Deletions58
Line Changes1,784
Total Commits4

User Affected:

  • Can now use a dedicated Vercel Postgres adapter for better performance and integration
  • Benefit from automatic connection string detection in Vercel environments
  • Experience faster invocation times due to removal of the `pg` dependency

Contributors:

paulpopusdenolfe