Skip to content

Commit

Permalink
chore: add server_name to asyncpg.connect
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon committed Sep 3, 2024
1 parent 2c549a3 commit 6e0f771
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions google/cloud/sql/connector/asyncpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

import ssl
from typing import Any, TYPE_CHECKING

Expand All @@ -27,20 +28,18 @@ async def connect(
) -> "asyncpg.Connection":
"""Helper function to create an asyncpg DB-API connection object.
:type ip_address: str
:param ip_address: A string containing an IP address for the Cloud SQL
instance.
Args:
ip_address (str): The IP address for the Cloud SQL instance.
:type ctx: ssl.SSLContext
:param ctx: An SSLContext object created from the Cloud SQL server CA
cert and ephemeral cert.
ctx (ssl.SSLContext): An SSL/TLS object created from the Cloud SQL
server CA cert and ephemeral cert.
:type kwargs: Any
:param kwargs: Keyword arguments for establishing asyncpg connection
object to Cloud SQL instance.
server_name (str): The server name of the Cloud SQL instance. Used to
verify the server identity for CAS instances.
:rtype: asyncpg.Connection
:returns: An asyncpg.Connection object to a Cloud SQL instance.
Returns:
(asyncpg.Connection) An asyncpg connection object to the Cloud SQL
instance.
"""
try:
import asyncpg
Expand Down

0 comments on commit 6e0f771

Please sign in to comment.