supabase/supabase-flutter/supabase-migrate-v3
- community
Checking that the SKILL.md file is still in the repository.
Migrates a Dart or Flutter project from supabase v2 to v3, including the renamed gotrue, realtime_client, storage_client and functions_client packages. Generates a typed database schema with the Supabase CLI, applies every breaking change from the migration guide, and moves queries from the untyped from() API to the typed table() API. Use when the user asks to upgrade or migrate Supabase to v3, bumps supabase to ^3, or hits v3 breaking changes.
Install
npx vskill@latest install supabase/supabase-flutter/supabase-migrate-v3SKILL.md
Migrate supabase from v2 to v3
The full migration guide is in references/migration-v2-v3.md. Its section headings name the symbol that changed, so search it for the symbol in a compiler error or in the code you are changing. Every "Before" and "After" snippet there is authoritative. This file is the order to apply it in and the checks that make the migration complete.
Rules
- Follow the steps in order. Do not skip the Supabase CLI check.
- Never write the table definitions by hand. They come from
supabase gen types --lang dart, and the generated file is never edited.
- Every query ends up on the typed
table()API unless it matches one of the
exceptions in step 8. Report every exception to the user.
- Keep the behavior of the app. Where v3 changed a default, pin the v2
behavior explicitly unless the user asks for the new one.
- Do not suppress analyzer errors or warnings to get a clean run. Fix them.
- Ask the user before a choice that changes runtime behavior and is not
covered here.
1. Preflight
- Read
pubspec.yaml. Note which of these are dependencies and their
versions: supabase_flutter, supabase, gotrue, postgrest, realtime_client, storage_client, functions_client.
- Run
git status. If the tree is dirty, ask the user to commit or stash
first so the migration is one reviewable diff.
- Run
dart analyzeand save the output. Issues that exist before the
migration are the baseline, and step 9 is measured against it.
- Check for a
supabase/folder withconfig.tomlandmigrations/. It
decides the source of the generated types in step 4.
2. Supabase CLI 2.122.0 or newer
Dart generation requires Supabase CLI 2.122.0 or newer.
If the project runs the CLI through npm (a supabase entry in package.json), check npx supabase --version instead.
If the command is missing or prints a version below 2.122.0, stop and give the user the command for their platform, then wait until the version check passes:
| Install method | Upgrade command | |
|---|---|---|
| Homebrew (macOS, Linux) | brew upgrade supabase/tap/supabase | |
| npm | npm install --save-dev supabase@latest | |
| Scoop (Windows) | scoop update supabase | |
| Not installed | https://supabase.com/docs/guides/local-development/cli/getting-started |
Do not continue on an older CLI and do not fall back to hand-written types.
3. Pin the changed order() defaults while still on v2
v3 changed two defaults of order() without a compile error. Both pins below already mean the same thing on v2, so add them before upgrading:
- A call without
ascending:sorted descending on v2 and sorts ascending on
v3. Add ascending: false.
- A query that sorts descending (including the ones you just changed) put
NULLs last on v2 and puts them first on v3. When the column is nullable, add nullsFirst: false. This does not apply to stream().order(), which takes no null placement.
The direction pin applies to stream().order() too. The result is that every order() call states its direction and, on a descending query of a nullable column, its null placement.
4. Dependencies and the typed schema
Once supabase_typegen is added, its supabase-typegen-generate skill has the details of the generator, its options and its errors.
- Update the dependencies. Use the newest 3.x version of each package;
dart pub outdated lists it, prereleases included.
supabaseto 3.x.- Replace any direct dependency on a renamed package, and its imports:
| v2 | v3 | |
|---|---|---|
gotrue | supabase_auth | |
realtime_client | supabase_realtime | |
storage_client | supabase_storage | |
functions_client | supabase_functions |
A direct dependency that only duplicates what supabase already re-exports can be removed instead.
- Add the generator:
dart pub add dev:supabase_typegen. - Run
dart pub get. - Generate the schema. Pick the source:
- A
supabase/folder with migrations: runsupabase start(needs Docker),
then supabase gen types --lang dart --local.
- A project linked with
supabase link:--linked. - Otherwise ask the user for the project ref and use
--project-id <ref>.
Ask which schemas the app queries. Pass --schema for each schema other than public that the app uses. Write to lib/supabase_schema.g.dart unless the project already has a generated-code convention:
``sh supabase gen types --lang dart --local > lib/supabase_schema.g.dart ``
- Run
dart analyze lib/supabase_schema.g.dart. It must be clean. If it is
not, report the error to the user rather than editing the file.
5. Mechanical renames
Apply these across the project before reading compiler errors, since they remove most of them. The tables are in the reference:
- "The client packages are renamed": imports and the
GoTrue*type names,
such as GoTrueClient to AuthClient.
- "Abbreviations in the public API are spelled out": for example
queryParams: to queryParameters: and opts: to options:.
- "Plural enum names singularized" and "One shared
SortDirectionfor every
sort direction".
- "Every deprecated API is gone": for example
User.confirmedAtto
User.emailConfirmedAt and AuthUser to User.
6. Compiler-driven pass
- Run
dart analyze. - For each new error, search the reference for the symbol it names and apply
the "After" form of that section.
- Repeat until the only issues left are the baseline from step 1.
The sections that most often apply:
- "Sign-in methods that always issue a session return the
Session":
signInWithPassword() and others return the Session directly.
- "
AuthStateis a sealed class" and
"User.appMetadata is an AppMetadata and userMetadata is never null".
- "Realtime listener callbacks are now streams":
onPostgresChanges,
onBroadcast and the connection callbacks.
- "The auth client persists the session itself":
localStorage:and
LocalStorage subclasses become an AuthAsyncStorage.
- "Service exceptions share one base" and "
FunctionsExceptionis sealed". - "Every client takes one
SupabaseRetryOptions". - "Timestamps are
DateTimeinstead ofStringorint". - "
rpcis a getter", "insert()andupsert()no longer take filters" and
"The rest client and its builders are stateless".
7. Changes the compiler will not catch
Go through every item. For each one, search with the given pattern, read every match, and fix or confirm it. Keep a list of the sites you could not decide for the summary in step 9.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/supabase/skills/supabase-migrate-v3/SKILL.md
Popularity
- Repository stars
- 1,039
- Repository forks
- 312
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/supabase/supabase-flutter/supabase-migrate-v3)