본문으로 건너뛰기
Skillpedia
데이터베이스48k · #5452

planetscale

하는 일

PlanetScale은 MySQL 호환 데이터베이스를 관리하는 서비스입니다. 개발용 브랜치 같은 기능과 무중단 업데이트를 통해 데이터베이스를 안전하게 만들고 수정할 수 있습니다.

사용하는 경우

  • ✓업데이트 중에도 멈추지 않는 MySQL 데이터베이스가 필요할 때.
  • ✓운영 환경에 올리기 전에 별도 환경에서 데이터베이스 변경을 테스트할 때.
  • ✓확장 가능하고 안정적인 데이터베이스가 필요한 애플리케이션을 만들 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/planetscale/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/planetscale/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“‘us-east’ 지역에 ‘my-project’라는 새 데이터베이스를 어떻게 만들 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

`pscale` 명령줄 도구를 사용해 PlanetScale과 상호작용합니다. 데이터베이스를 만들고, Git과 비슷한 워크플로로 스키마(데이터베이스 구조)를 관리하며, 변경 사항을 안전하게 배포할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

PlanetScale

Use PlanetScale for serverless MySQL-compatible databases with non-blocking schema change workflows built on Vitess.

When to Use

  • You need a managed MySQL-compatible database with zero-downtime migrations.
  • Your team wants Git-like branching for schema development.
  • You are building a serverless or edge application that benefits from connection pooling.
  • You need horizontal sharding without managing Vitess directly.

Prerequisites

  • A PlanetScale account (free tier available).
  • The pscale CLI installed locally.
  • Node.js 18+ if using Prisma or other ORM integrations.

Install the pscale CLI

# macOS
brew install planetscale/tap/pscale

# Linux (deb)
curl -fsSL https://github.com/planetscale/cli/releases/latest/download/pscale_linux_amd64.deb -o pscale.deb
sudo dpkg -i pscale.deb

# Verify installation
pscale version

# Authenticate
pscale auth login

Create and Manage Databases

# Create a new database
pscale database create my-app --region us-east

# List databases
pscale database list

# Show database info
pscale database show my-app

# Delete a database (destructive)
pscale database delete my-app

Branching Workflow

PlanetScale branches work like Git branches for your database schema. The main branch is the production branch by default.

# Create a development branch from main
pscale branch create my-app add-users-table

# List all branches
pscale branch list my-app

# Open a shell on the branch to apply schema changes
pscale shell my-app add-users-table

Apply Schema Changes on a Branch

-- Inside the pscale shell on the development branch
CREATE TABLE users (
  id         BIGINT       NOT NULL AUTO_INCREMENT PRIMARY KEY,
  email      VARCHAR(255) NOT NULL,
  name       VARCHAR(255) NOT NULL,
  created_at TIMESTAMP    DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP    DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  UNIQUE KEY idx_users_email (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE orders (
  id         BIGINT    NOT NULL AUTO_INCREMENT PRIMARY KEY,
  user_id    BIGINT    NOT NULL,
  total      DECIMAL(10,2) NOT NULL DEFAULT 0.00,
  status     ENUM('pending','paid','shipped','cancelled') DEFAULT 'pending',
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  KEY idx_orders_user_id (user_id),
  KEY idx_orders_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

PlanetScale does not enforce foreign keys at the database level. Use application-level constraints or Vitess-level routing rules instead.

Deploy Requests

Deploy requests are the pull-request equivalent for database schemas. They show a diff, run linting, and merge non-blocking into production.

# Create a deploy request from branch to main
pscale deploy-request create my-app add-users-table

# List open deploy requests
pscale deploy-request list my-app

# Show diff for a deploy request
pscale deploy-request diff my-app 1

# Deploy (merge) the request
pscale deploy-request deploy my-app 1

# Close without deploying
pscale deploy-request close my-app 1

# Delete the branch after successful deploy
pscale branch delete my-app add-users-table

Connection Strings and Proxying

# Create a password (connection credential) for a branch
pscale password create my-app main production-creds

# Output includes host, username, and password for the connection string:
# mysql://USERNAME:PASSWORD@HOST/my-app?sslmode=verify_identity

# Proxy a branch to localhost for local development (no password needed)
pscale connect my-app add-users-table --port 3306

Environment Variable Pattern

# .env (local development using pscale connect)
DATABASE_URL="mysql://root@127.0.0.1:3306/my-app"

# .env.production (using PlanetScale connection string)
DATABASE_URL="mysql://USERNAME:PASSWORD@us-east.connect.psdb.cloud/my-app?sslaccept=strict"

Prisma Integration

// prisma/schema.prisma
datasource db {
  provider     = "mysql"
  url          = env("DATABASE_URL")
  relationMode = "prisma"   // required — PlanetScale does not support foreign keys
}

model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String
  orders    Order[]
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

model Order {
  id        Int      @id @default(autoincrement())
  userId    Int
  total     Decimal  @db.Decimal(10, 2)

…
자주 묻는 질문

PlanetScale의 ‘브랜치’란 무엇인가요?

개발하고 새 기능이나 변경을 테스트하는 데 쓰이는, 데이터베이스의 별도 사본입니다. 메인(운영) 데이터베이스에는 영향을 주지 않습니다.

‘Deploy Request’란 무엇인가요?

브랜치에서 한 변경 사항을 메인 브랜치에 합치는 요청입니다. 데이터베이스용 코드 리뷰와 같아서, 차이점을 보여 주고 안전한 배포를 가능하게 합니다.

PlanetScale을 쓰려면 돈을 내야 하나요?

아니요, 시작할 수 있는 무료 요금제가 있습니다. 더 고급 기능이나 더 큰 용량이 필요할 때만 비용을 냅니다.

상세 정보

작성자의 원본 설명

Operate MySQL-compatible databases on PlanetScale with branching workflows, safe migrations, and production rollouts.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5452
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬