3
3
from __future__ import annotations
4
4
5
5
from typing import Any , List , Type , cast
6
+ from typing_extensions import Literal
6
7
7
8
import httpx
8
9
@@ -47,6 +48,7 @@ def create(
47
48
* ,
48
49
account_id : str ,
49
50
name : str ,
51
+ primary_location_hint : Literal ["wnam" , "enam" , "weur" , "eeur" , "apac" , "oc" ] | NotGiven = NOT_GIVEN ,
50
52
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
53
# The extra values given here take precedence over values defined on the client or passed to this method.
52
54
extra_headers : Headers | None = None ,
@@ -60,6 +62,9 @@ def create(
60
62
Args:
61
63
account_id: Account identifier tag.
62
64
65
+ primary_location_hint: Specify the region to create the D1 primary, if available. If this option is
66
+ omitted, the D1 will be created as close as possible to the current user.
67
+
63
68
extra_headers: Send extra headers
64
69
65
70
extra_query: Add additional query parameters to the request
@@ -72,7 +77,13 @@ def create(
72
77
raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
73
78
return self ._post (
74
79
f"/accounts/{ account_id } /d1/database" ,
75
- body = maybe_transform ({"name" : name }, database_create_params .DatabaseCreateParams ),
80
+ body = maybe_transform (
81
+ {
82
+ "name" : name ,
83
+ "primary_location_hint" : primary_location_hint ,
84
+ },
85
+ database_create_params .DatabaseCreateParams ,
86
+ ),
76
87
options = make_request_options (
77
88
extra_headers = extra_headers ,
78
89
extra_query = extra_query ,
@@ -248,6 +259,9 @@ def query(
248
259
Args:
249
260
account_id: Account identifier tag.
250
261
262
+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
263
+ be executed as a batch.
264
+
251
265
extra_headers: Send extra headers
252
266
253
267
extra_query: Add additional query parameters to the request
@@ -301,6 +315,9 @@ def raw(
301
315
Args:
302
316
account_id: Account identifier tag.
303
317
318
+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
319
+ be executed as a batch.
320
+
304
321
extra_headers: Send extra headers
305
322
306
323
extra_query: Add additional query parameters to the request
@@ -347,6 +364,7 @@ async def create(
347
364
* ,
348
365
account_id : str ,
349
366
name : str ,
367
+ primary_location_hint : Literal ["wnam" , "enam" , "weur" , "eeur" , "apac" , "oc" ] | NotGiven = NOT_GIVEN ,
350
368
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
351
369
# The extra values given here take precedence over values defined on the client or passed to this method.
352
370
extra_headers : Headers | None = None ,
@@ -360,6 +378,9 @@ async def create(
360
378
Args:
361
379
account_id: Account identifier tag.
362
380
381
+ primary_location_hint: Specify the region to create the D1 primary, if available. If this option is
382
+ omitted, the D1 will be created as close as possible to the current user.
383
+
363
384
extra_headers: Send extra headers
364
385
365
386
extra_query: Add additional query parameters to the request
@@ -372,7 +393,13 @@ async def create(
372
393
raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
373
394
return await self ._post (
374
395
f"/accounts/{ account_id } /d1/database" ,
375
- body = await async_maybe_transform ({"name" : name }, database_create_params .DatabaseCreateParams ),
396
+ body = await async_maybe_transform (
397
+ {
398
+ "name" : name ,
399
+ "primary_location_hint" : primary_location_hint ,
400
+ },
401
+ database_create_params .DatabaseCreateParams ,
402
+ ),
376
403
options = make_request_options (
377
404
extra_headers = extra_headers ,
378
405
extra_query = extra_query ,
@@ -548,6 +575,9 @@ async def query(
548
575
Args:
549
576
account_id: Account identifier tag.
550
577
578
+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
579
+ be executed as a batch.
580
+
551
581
extra_headers: Send extra headers
552
582
553
583
extra_query: Add additional query parameters to the request
@@ -601,6 +631,9 @@ async def raw(
601
631
Args:
602
632
account_id: Account identifier tag.
603
633
634
+ sql: Your SQL query. Supports multiple statements, joined by semicolons, which will
635
+ be executed as a batch.
636
+
604
637
extra_headers: Send extra headers
605
638
606
639
extra_query: Add additional query parameters to the request
0 commit comments