惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
Jina AI
Jina AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Martin Fowler
Martin Fowler
T
Tailwind CSS Blog
B
Blog RSS Feed
Vercel News
Vercel News
博客园 - 聂微东
I
InfoQ
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
Recent Announcements
Recent Announcements
GbyAI
GbyAI
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
C
Check Point Blog
MongoDB | Blog
MongoDB | Blog
B
Blog

Blog — PlanetScale

Keeping a Postgres queue healthy — PlanetScale Patterns for Postgres Traffic Control — PlanetScale Graceful degradation in Postgres — PlanetScale High memory usage in Postgres is good, actually — PlanetScale Stripe Projects partnership: Provision PlanetScale Postgres and MySQL databases from the Stripe CLI — PlanetScale Enhanced tagging in Postgres Query Insights — PlanetScale Behind the scenes: How Database Traffic Control works — PlanetScale Introducing Database Traffic Control — PlanetScale Scaling Postgres connections with PgBouncer — PlanetScale Drizzle joins PlanetScale — PlanetScale Video Conferencing with Postgres — PlanetScale Faster PlanetScale Postgres connections with Cloudflare Hyperdrive — PlanetScale Introducing the PlanetScale MCP server — PlanetScale Database Transactions — PlanetScale Automating our changelog with Cursor commands — PlanetScale Postgres 18 is now available — PlanetScale Using MotherDuck with PlanetScale — PlanetScale $50 PlanetScale Metal is GA for Postgres — PlanetScale AI-Powered Postgres index suggestions — PlanetScale $5 PlanetScale is live — PlanetScale Announcing Vitess 23 — PlanetScale $50 PlanetScale Metal — PlanetScale Report on our investigation of the 2025-10-20 incident in AWS us-east-1 — PlanetScale $5 PlanetScale — PlanetScale Benchmarking Postgres 17 vs 18 — PlanetScale Larger than RAM Vector Indexes for Relational Databases — PlanetScale Partnering with Cloudflare to bring you the fastest globally distributed applications — PlanetScale Processes and Threads — PlanetScale PlanetScale for Postgres is now GA — PlanetScale Postgres High Availability with CDC — PlanetScale
Streamline database management using the PlanetScale Netl...
Taylor Barnett · 2023-09-13 · via Blog — PlanetScale

Taylor Barnett |

With the PlanetScale Netlify integration, connecting and deploying applications on Netlify that use a PlanetScale database is now easier. Today, the integration is generally available and will allow you to deploy faster with an even better developer experience. The integration follows the release of the new Netlify SDK, enabling the development of new features such as this.

Let's walk through a few of the benefits of the integration and how you can get started today.

No more copying and pasting connection strings

With the Netlify PlanetScale integration, you no longer need to copy and paste connection strings from PlanetScale to Netlify. The integration uses PlanetScale's OAuth applications feature to log you into PlanetScale securely. Then, it allows you to select which database and branch you want to use. No more copying and pasting or accidentally inputting the wrong connection string for your database's environment variables. This can help prevent mistakes and speed up the deployment process.

Different branches for different deploy contexts

It is easy to mix up connection strings when you have different deploy contexts while application and database changes are simultaneously occurring. The integration will also allow you to assign a branch to a specific deploy context, such as production, deploy preview, and local development. All while handling the connection strings for each behind the scenes for you. When your application builds in Netlify, the integration will handle wiring up the correct branch for you.

The configuration options for a PlanetScale branch in Netlify.

Works seamlessly with PlanetScale's Fetch API-compatible database driver

The MySQL binary protocol does not work well in edge compute environments. This is why we have created a JavaScript library that can be used in any Fetch API-compatible environment. The library uses HTTP instead of the MySQL binary protocol over a raw TCP socket. Even better, the @netlify/planetscale library uses @planetscale/database so you can connect to and make calls to your PlanetScale database from your code with Netlify Functions.

First, you will need to import the necessary dependencies:

npm install @netlify/planetscale @planetscale/database

And then, you can use the library in your Netlify Functions. Here is a TypeScript example:

import type { Handler } from '@netlify/functions'
import { withPlanetscale } from '@netlify/planetscale'

export const handler: Handler = withPlanetscale(async (event, context) => {
  const {
    planetscale: { connection }
  } = context
  const { body } = event
  if (!body) {
    return {
      statusCode: 400,
      body: 'Missing body'
    }
  }
  const { email, name } = JSON.parse(body)
  await connection.execute('INSERT INTO users (email, name) VALUES (?, ?)', [email, name])
  return {
    statusCode: 201
  }
})

Getting started with the Netlify integration

See the PlanetScale integration page in the Netlify docs to get started with the integration.

If you have any suggestions for future features related to the integration, please let us know by tweeting at @planetscale or dropping us a note.