Generate database-aware code with the Google Databases Gemini Code Assist tool Stay organized with collections Save and categorize content based on your preferences.
Preview
This product or feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA products and features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.
The Gemini Code Assist Google Databases tool is available as part ofGemini Code Assist Standard and Enterprise edition.
You can use the Google Databases tool prompt@GoogleDatabases
in theGemini Code Assist chat to generate database-aware application code forCloud SQL in your integrated development environment (IDE).
Before you begin
The first three steps should be done by an administrator, and the remaining stepcan be completed by individual developers.
- Install Gemini Code Assist.
- Enable Data Catalog in Cloud SQL by following the instructionsinManage your Cloud SQL resources using Data Catalog.
- Enable the Google Databases tool for users by following the steps inEnable Gemini Code Assist tools.
- Install the Google Databases tool in your IDE by following the steps inConfigure tools.
Generate a function
In your IDE, navigate to the Gemini Code Assist chat and enter thefollowing prompt:
@GoogleDatabases generate a functionFEATURE
ReplaceFEATURE with the feature requirement that you want togenerate code for. For example, you could generate a function to getcustomers 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-awarecode 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 betweenthe last two months
@GoogleDatabases generate a function that returns the top 5 selling itemsover the past week
What's next
- Learn more about Gemini Code Assist tools by reading theTools overview.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.