mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-02-03 19:55:31 -05:00
## Description
---
This change introduces a new tool for creating databases within a Google
Cloud SQL instance.
The new tool, `create-database`, is part of the `cloud-sql-admin` source
and allows users to programmatically create new databases.
**Changes:**
* Added a new tool definition in
`internal/tools/cloudsql/cloudsqlcreatedatabase/cloudsqlcreatedatabase.go`.
* The tool requires the following parameters:
* `project`: The Google Cloud project ID.
* `instance`: The ID of the Cloud SQL instance.
* `name`: The desired name for the new database.
* The tool uses the `sqladmin.Databases.Insert` API to perform the
creation operation.
## PR Checklist
---
> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:
- [x] Make sure you reviewed
[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [x] Make sure to open an issue as a
[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Code coverage does not decrease (if any source code was changed)
- [x] Appropriate docs were updated (if necessary)
- [ ] Make sure to add `!` if this involve a breaking change
🛠️ Fixes #<issue_number_goes_here>
40 lines
1.5 KiB
Markdown
40 lines
1.5 KiB
Markdown
---
|
|
title: cloud-sql-create-database
|
|
type: docs
|
|
weight: 10
|
|
description: >
|
|
Create a new database in a Cloud SQL instance.
|
|
---
|
|
|
|
The `cloud-sql-create-database` tool creates a new database in a specified Cloud SQL instance.
|
|
|
|
{{< notice info >}}
|
|
This tool uses a `source` of kind `cloud-sql-admin`.
|
|
{{< /notice >}}
|
|
|
|
## Example
|
|
|
|
```yaml
|
|
tools:
|
|
create-cloud-sql-database:
|
|
kind: cloud-sql-create-database
|
|
source: my-cloud-sql-admin-source
|
|
description: "Creates a new database in a Cloud SQL instance."
|
|
```
|
|
|
|
## Reference
|
|
|
|
| **field** | **type** | **required** | **description** |
|
|
| ----------- | :------: | :----------: | ------------------------------------------------ |
|
|
| kind | string | true | Must be "cloud-sql-create-database". |
|
|
| source | string | true | The name of the `cloud-sql-admin` source to use. |
|
|
| description | string | false | A description of the tool. |
|
|
|
|
## Input Parameters
|
|
|
|
| **parameter** | **type** | **required** | **description** |
|
|
| ------------- | :------: | :----------: | ------------------------------------------------------------------ |
|
|
| project | string | true | The project ID. |
|
|
| instance | string | true | The ID of the instance where the database will be created. |
|
|
| name | string | true | The name for the new database. Must be unique within the instance. |
|