Google Cloud samples
Search for samples demonstrating the usage of Google Cloud products.
For Terraform samples, see Resource samples and Blueprints.
Configure SSL certificates for TCP connection by using Python
Configure SSL (Secure Sockets Layer) certificates for a TCP connection to Cloud SQL for SQL Server by using Python's sqlalchemy package.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- Python
- Sample
Set the connection timeout when using ADO.NET
Demonstrates configuring the connection timeout when connecting to Cloud SQL for SQL Server using the ADO.NET Connection object.
- Cloud SQL
- Cloud SQL for SQL Server
- Google Cloud
- C#
- Sample
Implement exponential backoff when using ADO.NET
Demonstrates how to implement exponential backoff to retry failed connections when connecting to Cloud SQL for SQL Server using ADO.NET with the Polly .NET library.
- Cloud SQL for SQL Server
- Google Cloud
- Cloud SQL
- C#
- Sample
Set the connection timeout when using SQLAlchemy
Demonstrates the configuration of a connection timeout when connecting to Cloud SQL for SQL Server using SQLAlchemy.
- Cloud SQL
- Cloud SQL for SQL Server
- Google Cloud
- Python
- Sample
Create a TCP connection by using Python
Open a TCP connection to Cloud SQL for SQL Server by using Python.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- Python
- Sample
C#: SQL Server ADO.NET connection
Demonstrates executing a SQL INSERT statement by opening and closing a connection to Cloud SQL for SQL Server using the ADO.NET System.Data.Common package.
- Cloud SQL for SQL Server
- Cloud SQL
- Google Cloud
- C#
- Sample
Create a TCP connection by using Java
Open a TCP connection to Cloud SQL for SQL Server by using Java.
- Cloud SQL for SQL Server
- Google Cloud
- Cloud SQL
- Java
- Sample
Retrying failed connections using the Node.js mssql module
Code comment that explains how failed connections are retried when connecting to Cloud SQL for SQL Server using the Node.js mssql module.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- JavaScript
- Node JS
- Sample
Set connection pool and overflow limits when using ADO.NET
Demonstrates configuring the connection pool size and overflow when connecting to Cloud SQL for SQL Server using the ADO.NET Connection object.
- Cloud SQL
- Cloud SQL for SQL Server
- Google Cloud
- C#
- Sample
Python: SQL Server SQLAlchemy opening and closing connections
Demonstrates executing a SQL INSERT statement by opening and closing a connection to Cloud SQL for SQL Server using SQLAlchemy.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- Python
- Sample
Set connection pool and overflow limits when using SQLAlchemy
Demonstrates the configuration of a connection pool size and overflow when connecting to Cloud SQL for SQL Server using SQLAlchemy.
- Cloud SQL
- Cloud SQL for SQL Server
- Google Cloud
- Python
- Sample
Set the connection duration when using ADO.NET
Demonstrates the configuration of the maximum number of seconds a connection can persist when connecting to Cloud SQL for SQL Server using the ADO.NET Connection object.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- C#
- Sample
Create a TCP connection by using PHP
Open a TCP connection to Cloud SQL for SQL Server by using PHP.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- PHP
- Sample
Set connection pool and overflow limits when using Go
Demonstrates configuring the connection pool size and overflow when connecting to Cloud SQL for SQL Server using Go's database/sql package.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- Go
- Sample
Set the connection timeout when using Node.js
Demonstrates configuring the connection timeout when connecting to Cloud SQL for SQL Server using the Node.js mssql module.
- Cloud SQL for SQL Server
- Google Cloud
- Cloud SQL
- Node JS
- JavaScript
- Sample
Create a TCP connection when using Go
Demonstrates opening a TCP connection to Cloud SQL for SQL Server using Go's database/sql package.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- Go
- Sample
Ruby: SQL Server ActiveRecord connection
Demonstrates inserting data using ActiveRecord to manage opening and closing a connection to Cloud SQL for SQL Server.
- Cloud SQL
- Cloud SQL for SQL Server
- Google Cloud
- Ruby
- Sample
Create a connection using the Cloud SQL Java Connector
Open a connection to Cloud SQL for SQL Server by using the Cloud SQL Java Connector.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- Java
- Sample
Create a connection using the Cloud SQL Go Connector
Open a connection to Cloud SQL for SQL Server by using the Cloud SQL Go Connector.
- Cloud SQL
- Google Cloud
- Cloud SQL for SQL Server
- Go
- Sample
Retrying failed connections using SQLAlchemy
Code comment that explains how failed connections are retried when connecting to Cloud SQL for SQL Server using SQLAlchemy.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- Python
- Sample
Create a TCP connection when using ADO.NET
Demonstrates opening a TCP connection to Cloud SQL for SQL Server using an ADO.NET Connection object.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- C#
- Sample
Set connection pool and overflow limits when using Node.js
Demonstrates configuring the connection pool size and overflow when connecting to Cloud SQL for SQL Server using the Node.js mssql module.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- JavaScript
- Node JS
- Sample
Set the connection timeout when using PHP
Demonstrates the configuration of a connection timeout when connecting to Cloud SQL for SQL Server using the PHP Data Objects (PDO) extension.
- Cloud SQL for SQL Server
- Google Cloud
- Cloud SQL
- PHP
- Sample
Node.js: SQL Server - mssql connection
Demonstrates executing a SQL INSERT statement by opening and closing a connection to Cloud SQL for SQL Server using the Node.js mssql module.
- Cloud SQL
- Cloud SQL for SQL Server
- Google Cloud
- Node JS
- JavaScript
- Sample
Set the connection timeout when using Go
Demonstrates configuring the connection timeout when connecting to Cloud SQL for SQL Server using Go's database/sql package.
- Cloud SQL
- Google Cloud
- Cloud SQL for SQL Server
- Go
- Sample
Configure SSL certificates for TCP connection by using Go
Configure SSL (Secure Sockets Layer) certificates for a TCP connection to Cloud SQL for SQL Server by using Go's database/sql package.
- Cloud SQL for SQL Server
- Google Cloud
- Cloud SQL
- Go
- Sample
Create a TCP connection when using Node.js
Demonstrates opening a TCP connection to Cloud SQL for SQL Server using the Node.js mssql module.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- JavaScript
- Node JS
- Sample
Go: SQL Server database sql connection
Demonstrates executing a SQL INSERT statement by opening and closing a connection to Cloud SQL for SQL Server using Go's database/sql package.
- Google Cloud
- Cloud SQL
- Cloud SQL for SQL Server
- Go
- Sample
Set the connection duration when using SQLAlchemy
Demonstrates the configuration of the maximum number of seconds a connection can persist when connecting to Cloud SQL for SQL Server using SQLAlchemy.
- Cloud SQL for SQL Server
- Cloud SQL
- Google Cloud
- Python
- Sample
Create a connection using the Cloud SQL Python Connector
Open a connection to Cloud SQL for SQL Server by using the Cloud SQL Python Connector.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- Python
- Sample
PHP: SQL Server PDO connection
Demonstrates executing a SQL INSERT statement by opening and closing a connection to Cloud SQL for SQL Server using the PHP Data Objects (PDO) extension.
- Google Cloud
- Cloud SQL for SQL Server
- Cloud SQL
- PHP
- Sample