{
  "slug": "gcloud-sql-instances-execute-sql-adds-user-and-secret-version-options-af122265ac18",
  "title": "gcloud sql instances execute-sql adds user and secret-version options",
  "tools": [
    "gcloud"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-30T00:00:00.000Z",
  "announced_at": "2026-06-30T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "To execute SQL with password authentication, pass the database user and Secret Manager password version to `gcloud sql instances execute-sql`.",
    "examples": [
      "gcloud sql instances execute-sql <INSTANCE> --sql='<SQL_STATEMENT>' --database=<DATABASE> --user=<USER> --password-secret-version=projects/<PROJECT>/locations/<LOCATION>/secrets/<SECRET>/versions/<SECRET_VERSION>"
    ],
    "gotchas": [
      "INSTANCE (required): Cloud SQL instance ID.",
      "--sql (required): SQL statement(s) to execute; multiple statements are supported.",
      "--database: Database on which to execute the statement.",
      "--user: Database user to authenticate as; used together with `--password-secret-version`.",
      "--password-secret-version: Secret Manager resource name holding the user's password; used together with `--user`. Expected format: `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}`.",
      "Prerequisite: Configure the database user and permissions according to the Cloud SQL Data API instructions before executing statements.",
      "Prerequisite: The password secret must be regional and stored in the same region as the Cloud SQL instance."
    ]
  },
  "why_it_matters": "Execute SQL against a Cloud SQL instance using a user and password secret version.",
  "sources": [
    "https://docs.cloud.google.com/sdk/docs/release-notes#57500_2026-06-30",
    "https://docs.cloud.google.com/sdk/gcloud/reference/sql/instances/execute-sql",
    "https://docs.cloud.google.com/sql/docs/mysql/executesql-instance?hl=en"
  ],
  "rank": 0.9702,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v1+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "cloud-20261008",
    "verdict_id": "cloud-20261008:cloud-20261008-f47ce93817a15906-18:gate",
    "evidence_hash": "1fdd9088d25a0e6edc4c036a17a548fbb0969f3ebc5eb2baa124e33e7feecebd"
  },
  "review": {
    "draft_hash": "e8f6b52ae25c3f148f4515ce83f0ab70970dd6a4bbbf05cb46c8f333b0d7debf",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "cloud-20261008:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.68 (>= 0.6 needed)."
  }
}
