Create a Database Schema and REST APIs with a Single Prompt Using GitHub Copilot in VS Code


Learn how to use GitHub Copilot with one AI prompt to create a fully designed database schema, deploy a serverless MySQL database, and live CRUD APIs — in under 60 seconds.



The Age of Prompt-Driven Development

A significant shift is underway in the way we develop software. AI agents and prompt-based tools are shaping modern development. As a developer, you don’t want to miss this shift. Knowing how to use these tools puts you ahead. Instead of writing endless boilerplate, you can now describe what you want, and AI will generate code, create your database, connect APIs, and even deploy your app. New tools like Cursor, Windsurf, Lovable, and Bolt are rising fast. You can create stunning apps and websites by chatting with AI.

Even with all these fancy tools, full-stack apps still need a solid backend, and that means data. Every application needs to work with data. Whether you’re building a blog, a booking platform, or an AI Agent, you’ll need to store and retrieve information. That usually means using a real database like PostgreSQL, MySQL, or MongoDB (unless you’re treating Excel or Google Sheets like a backend, which… we’ve all done once).

So schema design, database setup, and API generation can’t be skipped. I decided to experiment with automating the process of designing a database schema, running a database, and managing data using just prompts using GitHub Copilot in VS Code.



Every App Needs a Database — It’s Time to Simplify It

Working with databases is often repetitive work and slows developers down. I think the issues we always face are the following during the setup of a database from scratch:



You start with a manual schema setup

You have to create tables, think through relationships, indexes, data types, and naming. You map tables to objects using ORM libraries and build APIs to access that data. It’s easy to miss things or overcomplicate at an early stage.



Schema changes are painful

Your app evolves. You rename a column, split a table, or add a new relation. Now you need to write migrations. Update your ORM. Avoid downtime. And hope nothing breaks in staging or production.



Every change triggers more boilerplate

Once the schema changes, you usually:

  • Update model files
  • Fix serializers or DTOs
  • Rewrite REST API endpoints or GraphQL resolvers
  • Modify test data and fixtures

That’s a lot of work for just one change.



Team coordination becomes tricky

In team projects, syncing schema changes between developers often leads to merge conflicts, broken migrations, or inconsistent environments.

But now? With the rise of AI code generation tools like GitHub Copilot, you can extend Copilot Chat with the Model Context Protocol (MCP) from external providers, and you can create a fully working database schema with a single prompt — right inside VS Code.

And it’ll save you hours every week. Let me show you how you can achieve this.



Let’s Build: A Travel Agency App Schema



What You Need



Step 1: Set Up GibsonAI CLI and Log In

Before using the GibsonAI MCP server, install GibsonAI’s CLI and log in:

uvx --from gibson-cli@latest gibson auth login
Enter fullscreen mode

Exit fullscreen mode

This logs you into your GibsonAI account so you can start using all CLI features.



Step 2: Enable MCP Server in VS Code

To use the GibsonAI MCP server inside your VS Code project, you’ll need to add a configuration script. Create a file in your project or inside an empty folder called mcp.json in the .vscode/folder. This file defines which GibsonAI MCP server to use for this project.

Copy and paste the following content into the .vscode/mcp.json file:

{
  "inputs": [],
  "servers": {
    "gibson": {
      "type": "stdio",
      "command": "uvx",
      "args": ["--from", "gibson-cli@latest", "gibson", "mcp", "run"]
    }
  }
}
Enter fullscreen mode

Exit fullscreen mode

Once this file is added, GibsonAI tools inside VS Code will connect to the MCP server.



Step 3: Describe Your Travel App Schema in a Prompt

Open GitHub Copilot Chat in VS Code, switch to Agent mode, and select the LLM model, such as GPT-4.1 or GPT-4o. You should see the available tools from GibsonA

GibsonAI MCP server tools in VS Code

Then enter a prompt like this:

“Create a database for a travel agency. It should include tables for destinations, bookings, users, and reviews. Each user can make bookings and write reviews. Each destination has a name, description, price, and rating.”

Describe Your Travel App Schema in GitHub Copilot Prompt

GibsonAI reads your prompt, creates a new database project, and magically generates:

  • A complete relational schema
  • Visual Entity-Relationship Diagram (ERD)
  • Proper foreign key constraints
  • UUIDs, timestamps, and standard fields
  • A clean MySQL or Postgres structure



Step 4: Deploy Your Schema and Enable CRUD APIs

Go to the GibsonAI app, log in, and open your newly created project. There, you can see and review the schema. Now you can click “Deploy” to launch your schema:

Deploy Your Schema in GibsonAI

Alternatively, you can use Copilot chat to deploy the database. GibsonAI hosts the serverless MySQL database. Now you can get the database connection string and connect to your existing app. Or access live CRUD APIs and use them in your app:

Live CRUD APIs with GibsonAI

You now have a working backend without writing a single SQL query. You can plug these APIs directly into your frontend or backend — no need to write REST controllers for typical CRUD operations. GibsonAI also lets me share my database project schema with others.

Feel free to clone the travel agency database I created for the demo: https://app.gibsonai.com/clone/rRZ4wD9HDCdHO



Step 5: Let Copilot Help You Build Around the API

Now that your schema and API are live, use GitHub Copilot to build UI components using React or any other frontend frameworks. GitHub Copilot + GibsonAI MCP = the fastest way to go from prompt to full-featured app.



Final Thoughts

The future of development is not about using more AI-generated code. It’s about writing fewer, smarter prompts — and letting AI handle the slow, repetitive, or painful tasks so you can fully focus on the innovation. You can already boost your development workflow with GitHub Copilot Agent Mode. It will provide you with a powerful set of tools that enable agents to run SQL queries, create tables, design schemas, import CSV files, and more.

Give it a try. The next time you start a project, open VS Code, write a prompt, and let the database build itself.



Source link