[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Integrate with Cloud databases\n\nYou can write functions that integrate with Cloud databases by importing the\nappropriate Cloud Client Libraries for your chosen database into your source code.\nTo deploy and trigger the function, you can use either:\n\n- Cloud Run functions (Recommended)\n- The Cloud Functions gcloud CLI\n\nThis page provides more information for learning about connecting with a Cloud\ndatabase using Cloud Run.\n\nConnect to Cloud SQL\n--------------------\n\nLearn how to add database functionality to your Cloud Run with\nCloud SQL:\n\n- For connecting to a MySQL instance from a service running in Cloud Run, see [Connect from Cloud Run](/sql/docs/mysql/connect-run).\n- For connecting to a PostgreSQL instance from a service running in Cloud Run, see [Connect from Cloud Run](/sql/docs/postgres/connect-run).\n- For connecting to a SQL Server instance from a service running in Cloud Run, see [Connect from Cloud Run](/sql/docs/sqlserver/connect-run).\n\nConnect to Cloud BigQuery\n-------------------------\n\nLearn how to write an HTTP Cloud Run function that submits a query to\nBigQuery.\n\nFor details, see\n[Create a Cloud Run function that returns BigQuery results](/run/docs/tutorials/function-returns-bigquery-query).\n\nConnect to Memorystore for Redis\n--------------------------------\n\nLearn about how to connect your Cloud Run functions to\na Memorystore for Redis in-memory database.\n\nFor details, see\n[Connecting to a Redis instance from Cloud Run functions](/memorystore/docs/redis/connect-redis-instance-functions) in the\nMemorystore documentation.\n\nUser Spanner with Cloud Run functions\n-------------------------------------\n\nLearn about how to write, deploy, and trigger an HTTP Cloud Function that\naccesses Spanner.\n\nFor details, see\n[Create a Cloud Run function that returns Spanner results](/run/docs/tutorials/function-sends-query-to-spanner-database)."]]