You can use the Google Databases tool prompt @GoogleDatabases in the Gemini Code Assist chat to generate database-aware application code for Cloud SQL in your integrated development environment (IDE).
Before you begin
The first three steps should be done by an administrator, and the remaining step can be completed by individual developers.
Install the Google Databases tool in your IDE by following the steps in Configure tools.
Generate a function
In your IDE, navigate to the Gemini Code Assist chat and enter the following prompt:
@GoogleDatabases generate a function FEATURE
Replace FEATURE with the feature requirement that you want to generate code for. For example, you could generate a function to get customers by ID by entering the following prompt: @GoogleDatabases generate a function to get customers by ID
The Gemini Code Assist Google Databases tool returns database-aware code for the feature requirement.
Additional prompts
The following prompts are recommended for the Google Databases tool:
@GoogleDatabases generate a function that gets a sales comparison between the last two months
@GoogleDatabases generate a function that returns the top 5 selling items over the past week
What's next
Learn more about Gemini Code Assist tools by reading the Tools overview.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[],[],null,["# Generate database-aware code with the Google Databases Gemini Code Assist tool\n\n\u003cbr /\u003e\n\nMySQL \\| [PostgreSQL](/sql/docs/postgres/generate-functions-with-googledatabases-gemini-tool \"View this page for the PostgreSQL database engine\") \\| [SQL Server](/sql/docs/sqlserver/generate-functions-with-googledatabases-gemini-tool \"View this page for the SQL Server database engine\")\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThe Gemini Code Assist Google Databases tool is available as part of\n[Gemini Code Assist Standard and Enterprise edition](/gemini/docs/codeassist/overview).\n\nYou can use the Google Databases tool prompt `@GoogleDatabases` in the\nGemini Code Assist chat to generate database-aware application code for\nCloud SQL in your integrated development environment (IDE).\n\nBefore you begin\n----------------\n\nThe first three steps should be done by an administrator, and the remaining step\ncan be completed by individual developers.\n\n1. [Install Gemini Code Assist](/gemini/docs/discover/set-up-gemini).\n2. Enable Data Catalog in Cloud SQL by following the instructions in [Manage your Cloud SQL resources using Data Catalog](/sql/docs/mysql/dataplex-catalog-integration).\n3. Enable the Google Databases tool for users by following the steps in [Enable Gemini Code Assist tools](/gemini/docs/codeassist/tools-agents/enable-tools).\n4. Install the Google Databases tool in your IDE by following the steps in [Configure tools](/gemini/docs/codeassist/tools-agents/configure-tools).\n\nGenerate a function\n-------------------\n\n1. In your IDE, navigate to the Gemini Code Assist chat and enter the\n following prompt:\n\n @GoogleDatabases generate a function \u003cvar translate=\"no\"\u003eFEATURE\u003c/var\u003e\n\n Replace \u003cvar translate=\"no\"\u003eFEATURE\u003c/var\u003e with the feature requirement that you want to\n generate code for. For example, you could generate a function to get\n customers by ID by entering the following prompt:\n `@GoogleDatabases generate a function to get customers by ID`\n\n The Gemini Code Assist Google Databases tool returns database-aware\n code for the feature requirement.\n\nAdditional prompts\n------------------\n\nThe following prompts are recommended for the Google Databases tool:\n\n- `@GoogleDatabases generate a function that gets a sales comparison between\n the last two months`\n- `@GoogleDatabases generate a function that returns the top 5 selling items\n over the past week`\n\nWhat's next\n-----------\n\n- Learn more about Gemini Code Assist tools by reading the [Tools overview](/gemini/docs/codeassist/tools-agents/tools-overview)."]]