cloud-sql-python-connector 1.8.0__py2.py3-none-any.whl → 1.9.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/METADATA +2 -2
- {cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/RECORD +8 -8
- google/cloud/sql/connector/client.py +7 -3
- google/cloud/sql/connector/connector.py +150 -119
- google/cloud/sql/connector/version.py +1 -1
- {cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/LICENSE +0 -0
- {cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/WHEEL +0 -0
- {cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/top_level.txt +0 -0
{cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cloud-sql-python-connector
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
4
4
|
Summary: The Cloud SQL Python Connector is a library that can be used alongside a database driver to allow users with sufficient permissions to connect to a Cloud SQL database without having to manually allowlist IPs or manage SSL certificates.
|
|
5
5
|
Home-page: https://github.com/GoogleCloudPlatform/cloud-sql-python-connector
|
|
6
6
|
Author: Google LLC
|
|
@@ -26,7 +26,7 @@ Requires-Dist: google-auth
|
|
|
26
26
|
Provides-Extra: asyncpg
|
|
27
27
|
Requires-Dist: asyncpg (>=0.29.0) ; extra == 'asyncpg'
|
|
28
28
|
Provides-Extra: pg8000
|
|
29
|
-
Requires-Dist: pg8000 (>=1.
|
|
29
|
+
Requires-Dist: pg8000 (>=1.31.1) ; extra == 'pg8000'
|
|
30
30
|
Provides-Extra: pymysql
|
|
31
31
|
Requires-Dist: PyMySQL (>=1.1.0) ; extra == 'pymysql'
|
|
32
32
|
Provides-Extra: pytds
|
{cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/RECORD
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
google/cloud/sql/connector/__init__.py,sha256=Z3AkPOQwjNF1ogo2DR18GN-CnYvI4MTmhsCe8hURKUo,883
|
|
2
2
|
google/cloud/sql/connector/asyncpg.py,sha256=c4lAlvEgGf_eBq0G8MVNPRAJQQvo6DcwybiXDW36qkU,1838
|
|
3
|
-
google/cloud/sql/connector/client.py,sha256=
|
|
4
|
-
google/cloud/sql/connector/connector.py,sha256=
|
|
3
|
+
google/cloud/sql/connector/client.py,sha256=NZZnPqE_f13S04tpRCs0UGF-RxR4EL-_vH7ebQBXTaA,8494
|
|
4
|
+
google/cloud/sql/connector/connector.py,sha256=WYWP5zUqGSgxWNARaVHO1720REVX-EdD5D4rmBw0Mbw,19188
|
|
5
5
|
google/cloud/sql/connector/exceptions.py,sha256=rTBtbCoiZ3U5IFVsyXPw5baHbCODixx2hPDQeXUzgzs,1524
|
|
6
6
|
google/cloud/sql/connector/instance.py,sha256=G7-SCqsLjZiOYZ-Ds2RIErs6oaT0ewnAN683fs7EebI,14920
|
|
7
7
|
google/cloud/sql/connector/pg8000.py,sha256=EZuO7XgCkG_Y79NQlh3Vv8Ff2w85BFJyFVO237hx1GM,1814
|
|
@@ -11,9 +11,9 @@ google/cloud/sql/connector/pytds.py,sha256=vKJoE7E2P0GrhZojg8bGZkqCMLc8dgKAcXE4e
|
|
|
11
11
|
google/cloud/sql/connector/rate_limiter.py,sha256=bPTupfM4f5QRSCmCAWMqjQylEB7bUM-50plVBU3W2CA,2993
|
|
12
12
|
google/cloud/sql/connector/refresh_utils.py,sha256=P2ye3qDymdK1iOlGCXby4VIaqwvHdc9GEmuUsMcufxY,3680
|
|
13
13
|
google/cloud/sql/connector/utils.py,sha256=FQs7RgoViJLIFgJIynVT-_DwAVWnpyXIKu5WZ4m10Ts,3448
|
|
14
|
-
google/cloud/sql/connector/version.py,sha256=
|
|
15
|
-
cloud_sql_python_connector-1.
|
|
16
|
-
cloud_sql_python_connector-1.
|
|
17
|
-
cloud_sql_python_connector-1.
|
|
18
|
-
cloud_sql_python_connector-1.
|
|
19
|
-
cloud_sql_python_connector-1.
|
|
14
|
+
google/cloud/sql/connector/version.py,sha256=YbELZlL2XCm9DhI5YdFuGTTRXdNla7msYYRyECFExSQ,597
|
|
15
|
+
cloud_sql_python_connector-1.9.0.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
16
|
+
cloud_sql_python_connector-1.9.0.dist-info/METADATA,sha256=20TIdOSzRhkL8LmlNEH8pFpqv2EXtwUxoJKBEudmwps,24102
|
|
17
|
+
cloud_sql_python_connector-1.9.0.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
|
|
18
|
+
cloud_sql_python_connector-1.9.0.dist-info/top_level.txt,sha256=_1QvSJIhFAGfxb79D6DhB7SUw2X6T4rwnz_LLrbcD3c,7
|
|
19
|
+
cloud_sql_python_connector-1.9.0.dist-info/RECORD,,
|
|
@@ -31,13 +31,14 @@ if TYPE_CHECKING:
|
|
|
31
31
|
|
|
32
32
|
USER_AGENT: str = f"cloud-sql-python-connector/{version}"
|
|
33
33
|
API_VERSION: str = "v1beta4"
|
|
34
|
+
DEFAULT_SERVICE_ENDPOINT: str = "https://sqladmin.googleapis.com"
|
|
34
35
|
|
|
35
36
|
logger = logging.getLogger(name=__name__)
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
def _format_user_agent(driver: Optional[str], custom: Optional[str]) -> str:
|
|
39
40
|
agent = f"{USER_AGENT}+{driver}" if driver else USER_AGENT
|
|
40
|
-
if custom:
|
|
41
|
+
if custom and isinstance(custom, str):
|
|
41
42
|
agent = f"{agent} {custom}"
|
|
42
43
|
return agent
|
|
43
44
|
|
|
@@ -45,7 +46,7 @@ def _format_user_agent(driver: Optional[str], custom: Optional[str]) -> str:
|
|
|
45
46
|
class CloudSQLClient:
|
|
46
47
|
def __init__(
|
|
47
48
|
self,
|
|
48
|
-
sqladmin_api_endpoint: str,
|
|
49
|
+
sqladmin_api_endpoint: Optional[str],
|
|
49
50
|
quota_project: Optional[str],
|
|
50
51
|
credentials: Credentials,
|
|
51
52
|
client: Optional[aiohttp.ClientSession] = None,
|
|
@@ -81,7 +82,10 @@ class CloudSQLClient:
|
|
|
81
82
|
|
|
82
83
|
self._client = client if client else aiohttp.ClientSession(headers=headers)
|
|
83
84
|
self._credentials = credentials
|
|
84
|
-
|
|
85
|
+
if sqladmin_api_endpoint is None:
|
|
86
|
+
self._sqladmin_api_endpoint = DEFAULT_SERVICE_ENDPOINT
|
|
87
|
+
else:
|
|
88
|
+
self._sqladmin_api_endpoint = sqladmin_api_endpoint
|
|
85
89
|
self._user_agent = user_agent
|
|
86
90
|
|
|
87
91
|
async def _get_metadata(
|
|
@@ -43,47 +43,13 @@ from google.cloud.sql.connector.utils import generate_keys
|
|
|
43
43
|
logger = logging.getLogger(name=__name__)
|
|
44
44
|
|
|
45
45
|
ASYNC_DRIVERS = ["asyncpg"]
|
|
46
|
+
_DEFAULT_SCHEME = "https://"
|
|
47
|
+
_DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
|
|
48
|
+
_SQLADMIN_HOST_TEMPLATE = "sqladmin.{universe_domain}"
|
|
46
49
|
|
|
47
50
|
|
|
48
51
|
class Connector:
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
:type ip_type: str | IPTypes
|
|
52
|
-
:param ip_type
|
|
53
|
-
The IP type used to connect. IP types can be either IPTypes.PUBLIC
|
|
54
|
-
("PUBLIC"), IPTypes.PRIVATE ("PRIVATE"), or IPTypes.PSC ("PSC").
|
|
55
|
-
|
|
56
|
-
:type enable_iam_auth: bool
|
|
57
|
-
:param enable_iam_auth
|
|
58
|
-
Enables automatic IAM database authentication for Postgres or MySQL
|
|
59
|
-
instances.
|
|
60
|
-
|
|
61
|
-
:type timeout: int
|
|
62
|
-
:param timeout
|
|
63
|
-
The time limit for a connection before raising a TimeoutError.
|
|
64
|
-
|
|
65
|
-
:type credentials: google.auth.credentials.Credentials
|
|
66
|
-
:param credentials
|
|
67
|
-
Credentials object used to authenticate connections to Cloud SQL server.
|
|
68
|
-
If not specified, Application Default Credentials are used.
|
|
69
|
-
|
|
70
|
-
:type quota_project: str
|
|
71
|
-
:param quota_project
|
|
72
|
-
The Project ID for an existing Google Cloud project. The project specified
|
|
73
|
-
is used for quota and billing purposes. If not specified, defaults to
|
|
74
|
-
project sourced from environment.
|
|
75
|
-
|
|
76
|
-
:type loop: asyncio.AbstractEventLoop
|
|
77
|
-
:param loop
|
|
78
|
-
Event loop to run asyncio tasks, if not specified, defaults to
|
|
79
|
-
creating new event loop on background thread.
|
|
80
|
-
|
|
81
|
-
:type sqladmin_api_endpoint: str
|
|
82
|
-
:param sqladmin_api_endpoint:
|
|
83
|
-
Base URL to use when calling the Cloud SQL Admin API endpoint.
|
|
84
|
-
Defaults to "https://sqladmin.googleapis.com", this argument should
|
|
85
|
-
only be used in development.
|
|
86
|
-
"""
|
|
52
|
+
"""Configure and create secure connections to Cloud SQL."""
|
|
87
53
|
|
|
88
54
|
def __init__(
|
|
89
55
|
self,
|
|
@@ -93,9 +59,46 @@ class Connector:
|
|
|
93
59
|
credentials: Optional[Credentials] = None,
|
|
94
60
|
loop: Optional[asyncio.AbstractEventLoop] = None,
|
|
95
61
|
quota_project: Optional[str] = None,
|
|
96
|
-
sqladmin_api_endpoint: str =
|
|
62
|
+
sqladmin_api_endpoint: Optional[str] = None,
|
|
97
63
|
user_agent: Optional[str] = None,
|
|
64
|
+
universe_domain: Optional[str] = None,
|
|
98
65
|
) -> None:
|
|
66
|
+
"""Initializes a Connector instance.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
ip_type (str | IPTypes): The default IP address type used to connect to
|
|
70
|
+
Cloud SQL instances. Can be one of the following:
|
|
71
|
+
IPTypes.PUBLIC ("PUBLIC"), IPTypes.PRIVATE ("PRIVATE"), or
|
|
72
|
+
IPTypes.PSC ("PSC"). Default: IPTypes.PUBLIC
|
|
73
|
+
|
|
74
|
+
enable_iam_auth (bool): Enables automatic IAM database authentication
|
|
75
|
+
(Postgres and MySQL) as the default authentication method for all
|
|
76
|
+
connections.
|
|
77
|
+
|
|
78
|
+
timeout (int): The default time limit in seconds for a connection before
|
|
79
|
+
raising a TimeoutError.
|
|
80
|
+
|
|
81
|
+
credentials (google.auth.credentials.Credentials): A credentials object
|
|
82
|
+
created from the google-auth Python library to be used.
|
|
83
|
+
If not specified, Application Default Credentials (ADC) are used.
|
|
84
|
+
|
|
85
|
+
quota_project (str): The Project ID for an existing Google Cloud
|
|
86
|
+
project. The project specified is used for quota and billing
|
|
87
|
+
purposes. If not specified, defaults to project sourced from
|
|
88
|
+
environment.
|
|
89
|
+
|
|
90
|
+
loop (asyncio.AbstractEventLoop): Event loop to run asyncio tasks, if
|
|
91
|
+
not specified, defaults to creating new event loop on background
|
|
92
|
+
thread.
|
|
93
|
+
|
|
94
|
+
sqladmin_api_endpoint (str): Base URL to use when calling the Cloud SQL
|
|
95
|
+
Admin API endpoint. Defaults to "https://sqladmin.googleapis.com",
|
|
96
|
+
this argument should only be used in development.
|
|
97
|
+
|
|
98
|
+
universe_domain (str): The universe domain for Cloud SQL API calls.
|
|
99
|
+
Default: "googleapis.com".
|
|
100
|
+
|
|
101
|
+
"""
|
|
99
102
|
# if event loop is given, use for background tasks
|
|
100
103
|
if loop:
|
|
101
104
|
self._loop: asyncio.AbstractEventLoop = loop
|
|
@@ -131,38 +134,65 @@ class Connector:
|
|
|
131
134
|
self._timeout = timeout
|
|
132
135
|
self._enable_iam_auth = enable_iam_auth
|
|
133
136
|
self._quota_project = quota_project
|
|
134
|
-
self._sqladmin_api_endpoint = sqladmin_api_endpoint
|
|
135
137
|
self._user_agent = user_agent
|
|
136
138
|
# if ip_type is str, convert to IPTypes enum
|
|
137
139
|
if isinstance(ip_type, str):
|
|
138
140
|
ip_type = IPTypes._from_str(ip_type)
|
|
139
141
|
self._ip_type = ip_type
|
|
142
|
+
self._universe_domain = universe_domain
|
|
143
|
+
# construct service endpoint for Cloud SQL Admin API calls
|
|
144
|
+
if not sqladmin_api_endpoint:
|
|
145
|
+
self._sqladmin_api_endpoint = (
|
|
146
|
+
_DEFAULT_SCHEME
|
|
147
|
+
+ _SQLADMIN_HOST_TEMPLATE.format(universe_domain=self.universe_domain)
|
|
148
|
+
)
|
|
149
|
+
# otherwise if endpoint override is passed in use it
|
|
150
|
+
else:
|
|
151
|
+
self._sqladmin_api_endpoint = sqladmin_api_endpoint
|
|
152
|
+
|
|
153
|
+
# validate that the universe domain of the credentials matches the
|
|
154
|
+
# universe domain of the service endpoint
|
|
155
|
+
if self._credentials.universe_domain != self.universe_domain:
|
|
156
|
+
raise ValueError(
|
|
157
|
+
f"The configured universe domain ({self.universe_domain}) does "
|
|
158
|
+
"not match the universe domain found in the credentials "
|
|
159
|
+
f"({self._credentials.universe_domain}). If you haven't "
|
|
160
|
+
"configured the universe domain explicitly, `googleapis.com` "
|
|
161
|
+
"is the default."
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def universe_domain(self) -> str:
|
|
166
|
+
return self._universe_domain or _DEFAULT_UNIVERSE_DOMAIN
|
|
140
167
|
|
|
141
168
|
def connect(
|
|
142
169
|
self, instance_connection_string: str, driver: str, **kwargs: Any
|
|
143
170
|
) -> Any:
|
|
144
|
-
"""
|
|
145
|
-
background task to refresh the certificates and metadata.
|
|
171
|
+
"""Connect to a Cloud SQL instance.
|
|
146
172
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
name separated by colons.
|
|
173
|
+
Prepares and returns a database connection object connected to a Cloud
|
|
174
|
+
SQL instance using SSL/TLS. Starts a background refresh to periodically
|
|
175
|
+
retrieve up-to-date ephemeral certificate and instance metadata.
|
|
151
176
|
|
|
152
|
-
|
|
177
|
+
Args:
|
|
178
|
+
instance_connection_string (str): The instance connection name of the
|
|
179
|
+
Cloud SQL instance to connect to. Takes the form of
|
|
180
|
+
"project-id:region:instance-name"
|
|
153
181
|
|
|
154
|
-
|
|
155
|
-
:param: driver:
|
|
156
|
-
A string representing the driver to connect with. Supported drivers are
|
|
157
|
-
pymysql, pg8000, and pytds.
|
|
182
|
+
Example: "my-project:us-central1:my-instance"
|
|
158
183
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
SQL instance.
|
|
184
|
+
driver (str): A string representing the database driver to connect
|
|
185
|
+
with. Supported drivers are pymysql, pg8000, and pytds.
|
|
162
186
|
|
|
163
|
-
|
|
164
|
-
|
|
187
|
+
**kwargs: Any driver-specific arguments to pass to the underlying
|
|
188
|
+
driver .connect call.
|
|
189
|
+
|
|
190
|
+
Returns:
|
|
165
191
|
A DB-API connection to the specified Cloud SQL instance.
|
|
192
|
+
|
|
193
|
+
Raises:
|
|
194
|
+
ConnectorLoopError: Event loop for background refresh is running in
|
|
195
|
+
current thread. Error instead of hanging indefinitely.
|
|
166
196
|
"""
|
|
167
197
|
try:
|
|
168
198
|
# check if event loop is running in current thread
|
|
@@ -184,35 +214,37 @@ class Connector:
|
|
|
184
214
|
async def connect_async(
|
|
185
215
|
self, instance_connection_string: str, driver: str, **kwargs: Any
|
|
186
216
|
) -> Any:
|
|
187
|
-
"""
|
|
188
|
-
background task to refresh the certificates and metadata.
|
|
217
|
+
"""Connect asynchronously to a Cloud SQL instance.
|
|
189
218
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
219
|
+
Prepares and returns a database connection object connected to a Cloud
|
|
220
|
+
SQL instance using SSL/TLS. Schedules a refresh to periodically
|
|
221
|
+
retrieve up-to-date ephemeral certificate and instance metadata. Async
|
|
222
|
+
version of Connector.connect.
|
|
194
223
|
|
|
195
|
-
|
|
224
|
+
Args:
|
|
225
|
+
instance_connection_string (str): The instance connection name of the
|
|
226
|
+
Cloud SQL instance to connect to. Takes the form of
|
|
227
|
+
"project-id:region:instance-name"
|
|
196
228
|
|
|
197
|
-
|
|
198
|
-
:param: driver:
|
|
199
|
-
A string representing the driver to connect with. Supported drivers are
|
|
200
|
-
pymysql, pg8000, asyncpg, and pytds.
|
|
229
|
+
Example: "my-project:us-central1:my-instance"
|
|
201
230
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
SQL instance.
|
|
231
|
+
driver (str): A string representing the database driver to connect
|
|
232
|
+
with. Supported drivers are pymysql, asyncpg, pg8000, and pytds.
|
|
205
233
|
|
|
206
|
-
|
|
207
|
-
|
|
234
|
+
**kwargs: Any driver-specific arguments to pass to the underlying
|
|
235
|
+
driver .connect call.
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
208
238
|
A DB-API connection to the specified Cloud SQL instance.
|
|
239
|
+
|
|
240
|
+
Raises:
|
|
241
|
+
ValueError: Connection attempt with built-in database authentication
|
|
242
|
+
and then subsequent attempt with IAM database authentication.
|
|
243
|
+
KeyError: Unsupported database driver Must be one of pymysql, asyncpg,
|
|
244
|
+
pg8000, and pytds.
|
|
245
|
+
DnsNameResolutionError: Could not resolve PSC IP address from DNS
|
|
246
|
+
host name.
|
|
209
247
|
"""
|
|
210
|
-
# Create an Instance object from the connection string.
|
|
211
|
-
# The Instance should verify arguments.
|
|
212
|
-
#
|
|
213
|
-
# Use the Instance to establish an SSL Connection.
|
|
214
|
-
#
|
|
215
|
-
# Return a DBAPI connection
|
|
216
248
|
if self._client is None:
|
|
217
249
|
# lazy init client as it has to be initialized in async context
|
|
218
250
|
self._client = CloudSQLClient(
|
|
@@ -363,54 +395,53 @@ class Connector:
|
|
|
363
395
|
|
|
364
396
|
|
|
365
397
|
async def create_async_connector(
|
|
366
|
-
ip_type: IPTypes = IPTypes.PUBLIC,
|
|
398
|
+
ip_type: str | IPTypes = IPTypes.PUBLIC,
|
|
367
399
|
enable_iam_auth: bool = False,
|
|
368
400
|
timeout: int = 30,
|
|
369
401
|
credentials: Optional[Credentials] = None,
|
|
370
402
|
loop: Optional[asyncio.AbstractEventLoop] = None,
|
|
371
403
|
quota_project: Optional[str] = None,
|
|
372
|
-
sqladmin_api_endpoint: str =
|
|
404
|
+
sqladmin_api_endpoint: Optional[str] = None,
|
|
373
405
|
user_agent: Optional[str] = None,
|
|
406
|
+
universe_domain: Optional[str] = None,
|
|
374
407
|
) -> Connector:
|
|
375
|
-
"""
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
Defaults to "https://sqladmin.googleapis.com", this argument should
|
|
413
|
-
only be used in development.
|
|
408
|
+
"""Helper function to create Connector object for asyncio connections.
|
|
409
|
+
|
|
410
|
+
Force use of Connector in an asyncio context. Auto-detect and use current
|
|
411
|
+
thread's running event loop.
|
|
412
|
+
|
|
413
|
+
Args:
|
|
414
|
+
ip_type (str | IPTypes): The default IP address type used to connect to
|
|
415
|
+
Cloud SQL instances. Can be one of the following:
|
|
416
|
+
IPTypes.PUBLIC ("PUBLIC"), IPTypes.PRIVATE ("PRIVATE"), or
|
|
417
|
+
IPTypes.PSC ("PSC"). Default: IPTypes.PUBLIC
|
|
418
|
+
|
|
419
|
+
enable_iam_auth (bool): Enables automatic IAM database authentication
|
|
420
|
+
(Postgres and MySQL) as the default authentication method for all
|
|
421
|
+
connections.
|
|
422
|
+
|
|
423
|
+
timeout (int): The default time limit in seconds for a connection before
|
|
424
|
+
raising a TimeoutError.
|
|
425
|
+
|
|
426
|
+
credentials (google.auth.credentials.Credentials): A credentials object
|
|
427
|
+
created from the google-auth Python library to be used.
|
|
428
|
+
If not specified, Application Default Credentials (ADC) are used.
|
|
429
|
+
|
|
430
|
+
quota_project (str): The Project ID for an existing Google Cloud
|
|
431
|
+
project. The project specified is used for quota and billing
|
|
432
|
+
purposes. If not specified, defaults to project sourced from
|
|
433
|
+
environment.
|
|
434
|
+
|
|
435
|
+
loop (asyncio.AbstractEventLoop): Event loop to run asyncio tasks, if
|
|
436
|
+
not specified, defaults to creating new event loop on background
|
|
437
|
+
thread.
|
|
438
|
+
|
|
439
|
+
sqladmin_api_endpoint (str): Base URL to use when calling the Cloud SQL
|
|
440
|
+
Admin API endpoint. Defaults to "https://sqladmin.googleapis.com",
|
|
441
|
+
this argument should only be used in development.
|
|
442
|
+
|
|
443
|
+
Returns:
|
|
444
|
+
A Connector instance configured with running event loop.
|
|
414
445
|
"""
|
|
415
446
|
# if no loop given, automatically detect running event loop
|
|
416
447
|
if loop is None:
|
{cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/LICENSE
RENAMED
|
File without changes
|
{cloud_sql_python_connector-1.8.0.dist-info → cloud_sql_python_connector-1.9.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|