All entries

    Supabase MCP in Copilot: Inspect the Schema Before Proposing a Migration

    Use Supabase MCP in Copilot to inspect schema before drafting a migration. Keep read access, migration review and production execution as separate permissions.

    A pixel-art database architect studies a schema blueprint before a separate reviewed migration bridge can reach a protected database.
    Original GPT-generated pixel-art editorial illustration; conceptual artwork, not a product screenshot or test result.

    GitHub's new Supabase connector can provide database context to Copilot, including inspecting a schema before writing a migration. That is useful context, not permission to apply whatever SQL the model proposes. Keep discovery, draft generation, review, testing and production execution as separate steps with explicit access boundaries.

    Connect the intended project with the smallest useful access

    Use the supported connector flow and confirm which account and project you authorise. GitHub's announcement describes the relevant Copilot surfaces and managed-plan policy requirements. A successful sign-in is not proof that the selected project is the one you intended to inspect.

    Start with read-only context where the service and workflow support it. Review the connector's actual capabilities rather than assuming every MCP server is read-only. Keep credentials and connection details out of prompts, screenshots and public articles.

    Inspect more than table names

    A migration needs context about keys, constraints, indexes, relationships, defaults and access policies. A list of columns alone can hide the rule that makes an apparently simple change dangerous. Ask the assistant to state which facts it observed and which remain assumptions.

    For an invented notes table, adding an owner field is not complete until existing rows, nullability, indexes and row access are considered. The exact solution depends on the application. Do not copy a generic policy into production merely because it compiles.

    EXPLAINED / SYSTEM FLOW

    Read context before proposing a write

    A controlled migration workflow with an explicit review boundary.

    Prepare

    1. Authorised schema read

      Inspect the intended project and necessary metadata only.

    2. Migration draft

      Generate a proposed change with stated assumptions.

    Validate

    1. Review and test

      Check data effects, permissions, locks and rollback on a disposable environment.

    2. Approved execution

      Apply through the existing deployment process, then verify.

    THE KEY DISTINCTION

    A connector's ability to inspect a project does not grant blanket authorisation to change production.

    Author-created explanatory diagram. Arrows show the process described in the article, not measured performance.

    Draft the change with a concrete before-and-after

    Describe the user-visible behaviour and the data transition. For example, an invented feature may require each new note to belong to the authenticated user while preserving existing records during a backfill. That gives reviewers a contract more useful than improve the schema.

    Have the draft identify destructive operations, lock risks and assumptions about existing data. A model should not silently drop a column because it appears unused in the context it saw. Repository and database context can both be incomplete.

    Scroll the table horizontally to see all columns.

    Draft the change with a concrete before-and-after
    Review areaQuestionEvidence needed
    Existing dataWhat happens to current rows?Backfill and null-handling test
    AccessCan another user read or write the row?Cross-user permission tests
    PerformanceDoes the access path need an index?Query plan or representative observation
    DeploymentCan old and new app versions coexist?Compatible rollout sequence
    RecoveryCan the previous version operate again?Defined rollback or forward-fix plan

    Test on a disposable database

    Use invented data with edge cases: missing values, duplicate candidates, long text and records belonging to different test users. Apply the proposed migration there and run the application contract. A successful SQL execution only proves the database accepted the statements.

    Check unauthorised access explicitly. If a new policy is intended to isolate owners, use two test identities and prove that one cannot access the other's row. Do not relax the policy to make a frontend happy. Fix the identity or query path if the intended request is wrong.

    Keep execution in the normal deployment process

    A draft in a chat is not a production change record. Review the exact migration file and commit it through the project's established workflow. Preserve branch protections and required checks. If production execution requires a separate approval, do not treat the connector's technical capability as that approval.

    For long-running or destructive changes, assess backup, lock and recovery requirements with the database's official guidance. A reverse migration is not always able to recover deleted data. State that limitation before running the change, not after a failure.

    Verify the product behaviour after deployment

    Check both the database state and the application action that motivated the migration. Confirm the intended account can perform the task and a different account cannot. Observe errors and performance without logging private record contents.

    The connector's best contribution is better context before a proposal. The engineering responsibility remains the same: understand the data, review the diff, test permissions, deploy deliberately and verify the result. Faster SQL generation is useful only when those boundaries remain intact.

    Frequently asked questions

    Is the Supabase connector available in every managed Copilot setup automatically? No. GitHub describes public-preview availability with managed-plan policy requirements, and an MCP allowlist may need the connector added. Service-side permissions still apply.

    Should Copilot apply a migration immediately after reading the schema? No. Review the proposed change, test it on a disposable or staging environment and follow the project's existing approval and deployment process.

    Can this article include our private production schema? It does not. The examples are invented and focus on a general workflow. Private table names, customer fields, credentials and service addresses are unnecessary for the lesson.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 148
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    The example database is invented. This guide does not publish UltraFit360 tables, credentials, endpoints or migrations, and it does not claim that connecting MCP makes generated SQL safe automatically.

    Meet the author
    THE CONVERSATION

    Your side of the story.