Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问clear审计提醒

supabase-upgrade-migrationSupabase upgrade 迁移

Agent Skill

supabase-upgrade-migration 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

667

周安装

27

GitHub Stars

2,068

下载量

210
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:supabase-upgrade-migration(Supabase upgrade 迁移)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/supabase-upgrade-migration
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill supabase-upgrade-migration
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill supabase-upgrade-migration

简介

用于查找和检索 Supabase 升级与迁移相关的信息与方案,适合版本迭代支持。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 等宿主环境,支持关键词搜索与筛选。
  • 通过 npx 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网或文件读写操作。
  • supabase-upgrade-migration 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Supabase Upgrade Migration

Overview

Upgrade @supabase/supabase-js and the Supabase CLI with breaking-change detection, automated code migration, and rollback planning. Covers the v1-to-v2 migration path (auth method renames, data/error destructuring, realtime API overhaul), minor version bumps, @supabase/ssr adoption, and Python SDK upgrades via pip install --upgrade supabase.

Current State

!npm list @supabase/supabase-js 2>/dev/null | grep supabase || echo 'supabase-js not installed'!supabase --version 2>/dev/null || echo 'CLI not installed'!pip show supabase 2>/dev/null | grep Version || echo 'Python SDK not installed'

Prerequisites

  • @supabase/supabase-js or the Python supabase package installed in the project
  • Git with a clean working tree (no uncommitted changes)
  • Test suite available for post-upgrade verification
  • Node.js >= 18 (for supabase-js v2) or Python >= 3.8 (for Python SDK)

Instructions

Step 1: Audit Versions, Scan Usage, and Review Breaking Changes

Check every installed Supabase package and find all import sites in the codebase.

# Check current SDK version
npm list @supabase/supabase-js

# Check CLI version
supabase --version

# Check Python SDK version
pip show supabase | grep Version

# Find all JS/TS Supabase imports
grep -rn "from '@supabase/supabase-js'" --include="*.ts" --include="*.tsx" --include="*.js" src/ lib/ app/ 2>/dev/null
grep -rn "createClient" --include="*.ts" --include="*.tsx" --include="*.js" src/ lib/ app/ 2>/dev/null

# Find all Python Supabase imports
grep -rn "from supabase" --include="*.py" src/ app/ 2>/dev/null

supabase-js v1 → v2 breaking changes:

v1 Patternv2 ReplacementNotes
createClient(url, key)createClient(url, key)Signature unchanged, but return type differs
supabase.auth.session()supabase.auth.getSession()Sync → async, returns {data: {session}}
supabase.auth.user()supabase.auth.getUser()Sync → async, returns {data: {user}}
supabase.auth.signIn({email, password})supabase.auth.signInWithPassword({email, password})Method split by auth type
supabase.auth.signIn({provider: 'google'})supabase.auth.signInWithOAuth({provider: 'google'})OAuth separated
supabase.auth.signIn({email})supabase.auth.signInWithOtp({email})Magic link separated
supabase.auth.api.resetPasswordForEmail(e)supabase.auth.resetPasswordForEmail(e).api namespace removed
{data: subscription} from onAuthStateChange{data: {subscription}}Extra destructuring level
error.message string parsingerror.code enum (PGRST116, etc.)Reliable error matching
.single() returns error on 0 rows.maybeSingle() for optional rowsNew method for nullable results
supabase.from('t').on('INSERT', cb).subscribe()supabase.channel('c').on('postgres_changes',...).subscribe()Realtime v2 channel API
supabase.storage.from('b').download('path')Same, but returns {data: Blob, error}Consistent error/data tuple

Realtime v2 migration detail:

// v1 realtime
supabase
  .from('messages')
  .on('INSERT', (payload) => console.log(payload.new))
  .subscribe()

// v2 realtime — channel-based API
supabase
  .channel('messages-insert')
  .on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages' },
    (payload) => console.log(payload.new))
  .subscribe()

Step 2: Run the Upgrade and Apply Code Migrations

Create a branch, install new packages, and transform code to match v2 APIs.

# Create upgrade branch
git checkout -b upgrade-supabase-sdk

# Upgrade JS/TS SDK
npm install @supabase/supabase-js@latest

# Upgrade SSR helper (if used with Next.js/SvelteKit/Nuxt)
npm install @supabase/ssr@latest

# Upgrade CLI
npm install -g supabase@latest

# Upgrade Python SDK
pip install --upgrade supabase

# Regenerate TypeScript types from linked project
npx supabase gen types typescript --linked > lib/database.types.ts

# Generate a database migration if schema drifted
npx supabase db diff --use-migra -f upgrade_check

Apply auth code migrations:

// BEFORE (v1 auth patterns)
const session = supabase.auth.session()
const user = supabase.auth.user()
const { error } = await supabase.auth.signIn({ email, password })
const { data: subscription } = supabase.auth.onAuthStateChange(callback)

// AFTER (v2 auth patterns)
const { data: { session } } = await supabase.auth.getSession()
const { data: { user } } = await supabase.auth.getUser()
const { error } = await supabase.auth.signInWithPassword({ email, password })
const { data: { subscription } } = supabase.auth.onAuthStateChange(callback)

Apply error handling migration:

// BEFORE (v1 — string matching)
if (error.message.includes('not found')) { ... }

// AFTER (v2 — structured error codes)
if (error.code === 'PGRST116') { ... }  // "not found" → PGRST116

Step 3: Verify, Test, and Prepare Rollback

# Type check (catches 90% of migration issues)
npx tsc --noEmit

# Run test suite
npm test

# Python tests
python -m pytest tests/ -v

# Manual smoke test critical auth flows:
# 1. Sign up → confirm email → sign in with password
# 2. OAuth sign in → callback handling
# 3. Password reset → email → reset form
# 4. Session refresh across page navigations
# 5. Realtime subscription connect/disconnect
# 6. Storage upload/download round-trip

Rollback procedure (if upgrade causes issues):

# Option A: Pin to previous version
npm install @supabase/supabase-js@<previous-version>
pip install supabase==<previous-version>

# Option B: Revert the branch
git stash && git checkout main

Output

  • @supabase/supabase-js upgraded to latest version with npm list confirmation
  • All supabase.auth.signIn() calls migrated to signInWithPassword / signInWithOAuth / signInWithOtp
  • Sync auth methods (session(), user()) replaced with async getSession() / getUser()
  • Realtime subscriptions migrated from .on() to channel-based API
  • data/error destructuring updated where return shapes changed
  • TypeScript types regenerated from current schema
  • Test suite passing, type checking clean
  • Rollback branch or version pin documented

Error Handling

ErrorCauseSolution
Property 'session' does not existv1 sync .session() removed in v2Replace with await supabase.auth.getSession()
Property 'signIn' does not existsignIn split into multiple methods in v2Use signInWithPassword, signInWithOAuth, or signInWithOtp
supabase.auth.api is undefined.api namespace removed in v2Call methods directly on supabase.auth.*
TypeError: supabase.from(...).on is not a functionRealtime API replaced in v2Use supabase.channel().on('postgres_changes',...)
Type errors after gen typesDatabase schema changed between versionsUpdate application code to match new generated types
PGRST116 error on .single()Zero rows returned (v2 throws)Use .maybeSingle() for optional lookups
ERR_REQUIRE_ESM after upgradev2 is ESM-only in some bundlersUpdate tsconfig.json to "module": "esnext" or use dynamic import()
AuthSessionMissingErrorgetSession() called before auth initializedWrap in onAuthStateChange listener or check session!== null

Examples

Full v1 → v2 auth migration (Next.js):

// lib/supabase.ts — client initialization (unchanged API)
import { createClient } from '@supabase/supabase-js'
import type { Database } from './database.types'

export const supabase = createClient<Database>(
  process.env.NEXT_PUBLIC_SUPABASE_URL!,
  process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
)
// app/login/page.tsx — v2 auth flow
export async function login(email: string, password: string) {
  const { data, error } = await supabase.auth.signInWithPassword({
    email,
    password,
  })
  if (error) {
    // v2: use error.code instead of parsing error.message
    if (error.code === 'invalid_credentials') {
      return { success: false, message: 'Invalid email or password' }
    }
    throw error
  }
  return { success: true, session: data.session }
}
// hooks/useAuth.ts — v2 session listener
import { useEffect, useState } from 'react'
import { supabase } from '@/lib/supabase'
import type { Session } from '@supabase/supabase-js'

export function useAuth() {
  const [session, setSession] = useState<Session | null>(null)

  useEffect(() => {
    // v2: getSession is async, returns nested { data: { session } }
    supabase.auth.getSession().then(({ data: { session } }) => {
      setSession(session)
    })

    // v2: subscription nested one level deeper
    const { data: { subscription } } = supabase.auth.onAuthStateChange(
      (_event, session) => setSession(session)
    )

    return () => subscription.unsubscribe()
  }, [])

  return session
}

Python SDK upgrade:

# Before (supabase-py < 2.0)
from supabase import create_client
supabase = create_client(url, key)
data = supabase.table("users").select("*").execute()
users = data["data"]

# After (supabase-py >= 2.0)
from supabase import create_client, Client
supabase: Client = create_client(url, key)
response = supabase.table("users").select("*").execute()
users = response.data  # attribute access, not dict

Resources

Next Steps

For CI integration with the upgraded SDK, see supabase-ci-integration. For database migration workflows after schema changes, see supabase-migration-deep-dive.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

38.33%
按下载量换算80

Claude Code

32.83%
按下载量换算69

Antigravity

17.25%
按下载量换算36

Gemini CLI

8.64%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill supabase-upgrade-migration;npx skills add jeremylongshore/claude-code-plugins-plus-skills --skill "supabase-upgrade-migration" 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills