Link projects to a database
LinkDatabaseLets projects that exist reach a database project: inside each linked project the database is the host <database_project_id> at its port. Takes effect at once and deploys nothing, and writes nothing into a project's /.env: put Project.database.connection's url there (GetProject include_secret_values) with DeployProject files. A project it links signs in as the apps' user, app (a Valkey's one user), or as its user of its own if CreateProject's link_databases made it one there (own_user), which nothing else makes. INVALID_ARGUMENT = a project in both link and unlink. NOT_FOUND = no such project. FAILED_PRECONDITION = database_project_id is no database; + DatabaseLinkRefusal = the app is a database, has a service named or aliased like the database, or there are 20 links already. Answers with the database's Project.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "LinkDatabase"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| link | No | App project_ids to link. | |
| unlink | No | App project_ids to unlink. | |
| workspace | No | The workspace: its id or name (ListWorkspaces). Omit when the account has one. | |
| database_project_id | No |