22
33from __future__ import annotations
44
5- from typing import Type , Iterable , Optional , cast
5+ from typing import Type , Optional , cast
66from typing_extensions import Literal , overload
77
88import httpx
@@ -586,7 +586,6 @@ def import_(
586586 cast_to = cast (Type [DatabaseImportResponse ], ResultWrapper [DatabaseImportResponse ]),
587587 )
588588
589- @overload
590589 def query (
591590 self ,
592591 database_id : str ,
@@ -620,56 +619,6 @@ def query(
620619
621620 timeout: Override the client-level default timeout for this request, in seconds
622621 """
623- ...
624-
625- @overload
626- def query (
627- self ,
628- database_id : str ,
629- * ,
630- account_id : str ,
631- body : Iterable [database_query_params .MultipleQueriesBody ],
632- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
633- # The extra values given here take precedence over values defined on the client or passed to this method.
634- extra_headers : Headers | None = None ,
635- extra_query : Query | None = None ,
636- extra_body : Body | None = None ,
637- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
638- ) -> SyncSinglePage [QueryResult ]:
639- """
640- Returns the query result as an object.
641-
642- Args:
643- account_id: Account identifier tag.
644-
645- database_id: D1 database identifier (UUID).
646-
647- extra_headers: Send extra headers
648-
649- extra_query: Add additional query parameters to the request
650-
651- extra_body: Add additional JSON properties to the request
652-
653- timeout: Override the client-level default timeout for this request, in seconds
654- """
655- ...
656-
657- @required_args (["account_id" , "sql" ], ["account_id" , "body" ])
658- def query (
659- self ,
660- database_id : str ,
661- * ,
662- account_id : str ,
663- sql : str | Omit = omit ,
664- params : SequenceNotStr [str ] | Omit = omit ,
665- body : Iterable [database_query_params .MultipleQueriesBody ] | Omit = omit ,
666- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
667- # The extra values given here take precedence over values defined on the client or passed to this method.
668- extra_headers : Headers | None = None ,
669- extra_query : Query | None = None ,
670- extra_body : Body | None = None ,
671- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
672- ) -> SyncSinglePage [QueryResult ]:
673622 if not account_id :
674623 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
675624 if not database_id :
@@ -681,7 +630,6 @@ def query(
681630 {
682631 "sql" : sql ,
683632 "params" : params ,
684- "body" : body ,
685633 },
686634 database_query_params .DatabaseQueryParams ,
687635 ),
@@ -692,7 +640,6 @@ def query(
692640 method = "post" ,
693641 )
694642
695- @overload
696643 def raw (
697644 self ,
698645 database_id : str ,
@@ -728,58 +675,6 @@ def raw(
728675
729676 timeout: Override the client-level default timeout for this request, in seconds
730677 """
731- ...
732-
733- @overload
734- def raw (
735- self ,
736- database_id : str ,
737- * ,
738- account_id : str ,
739- body : Iterable [database_raw_params .MultipleQueriesBody ],
740- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
741- # The extra values given here take precedence over values defined on the client or passed to this method.
742- extra_headers : Headers | None = None ,
743- extra_query : Query | None = None ,
744- extra_body : Body | None = None ,
745- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
746- ) -> SyncSinglePage [DatabaseRawResponse ]:
747- """Returns the query result rows as arrays rather than objects.
748-
749- This is a
750- performance-optimized version of the /query endpoint.
751-
752- Args:
753- account_id: Account identifier tag.
754-
755- database_id: D1 database identifier (UUID).
756-
757- extra_headers: Send extra headers
758-
759- extra_query: Add additional query parameters to the request
760-
761- extra_body: Add additional JSON properties to the request
762-
763- timeout: Override the client-level default timeout for this request, in seconds
764- """
765- ...
766-
767- @required_args (["account_id" , "sql" ], ["account_id" , "body" ])
768- def raw (
769- self ,
770- database_id : str ,
771- * ,
772- account_id : str ,
773- sql : str | Omit = omit ,
774- params : SequenceNotStr [str ] | Omit = omit ,
775- body : Iterable [database_raw_params .MultipleQueriesBody ] | Omit = omit ,
776- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
777- # The extra values given here take precedence over values defined on the client or passed to this method.
778- extra_headers : Headers | None = None ,
779- extra_query : Query | None = None ,
780- extra_body : Body | None = None ,
781- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
782- ) -> SyncSinglePage [DatabaseRawResponse ]:
783678 if not account_id :
784679 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
785680 if not database_id :
@@ -791,7 +686,6 @@ def raw(
791686 {
792687 "sql" : sql ,
793688 "params" : params ,
794- "body" : body ,
795689 },
796690 database_raw_params .DatabaseRawParams ,
797691 ),
@@ -1353,7 +1247,6 @@ async def import_(
13531247 cast_to = cast (Type [DatabaseImportResponse ], ResultWrapper [DatabaseImportResponse ]),
13541248 )
13551249
1356- @overload
13571250 def query (
13581251 self ,
13591252 database_id : str ,
@@ -1387,56 +1280,6 @@ def query(
13871280
13881281 timeout: Override the client-level default timeout for this request, in seconds
13891282 """
1390- ...
1391-
1392- @overload
1393- def query (
1394- self ,
1395- database_id : str ,
1396- * ,
1397- account_id : str ,
1398- body : Iterable [database_query_params .MultipleQueriesBody ],
1399- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1400- # The extra values given here take precedence over values defined on the client or passed to this method.
1401- extra_headers : Headers | None = None ,
1402- extra_query : Query | None = None ,
1403- extra_body : Body | None = None ,
1404- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1405- ) -> AsyncPaginator [QueryResult , AsyncSinglePage [QueryResult ]]:
1406- """
1407- Returns the query result as an object.
1408-
1409- Args:
1410- account_id: Account identifier tag.
1411-
1412- database_id: D1 database identifier (UUID).
1413-
1414- extra_headers: Send extra headers
1415-
1416- extra_query: Add additional query parameters to the request
1417-
1418- extra_body: Add additional JSON properties to the request
1419-
1420- timeout: Override the client-level default timeout for this request, in seconds
1421- """
1422- ...
1423-
1424- @required_args (["account_id" , "sql" ], ["account_id" , "body" ])
1425- def query (
1426- self ,
1427- database_id : str ,
1428- * ,
1429- account_id : str ,
1430- sql : str | Omit = omit ,
1431- params : SequenceNotStr [str ] | Omit = omit ,
1432- body : Iterable [database_query_params .MultipleQueriesBody ] | Omit = omit ,
1433- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1434- # The extra values given here take precedence over values defined on the client or passed to this method.
1435- extra_headers : Headers | None = None ,
1436- extra_query : Query | None = None ,
1437- extra_body : Body | None = None ,
1438- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1439- ) -> AsyncPaginator [QueryResult , AsyncSinglePage [QueryResult ]]:
14401283 if not account_id :
14411284 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
14421285 if not database_id :
@@ -1448,7 +1291,6 @@ def query(
14481291 {
14491292 "sql" : sql ,
14501293 "params" : params ,
1451- "body" : body ,
14521294 },
14531295 database_query_params .DatabaseQueryParams ,
14541296 ),
@@ -1459,7 +1301,6 @@ def query(
14591301 method = "post" ,
14601302 )
14611303
1462- @overload
14631304 def raw (
14641305 self ,
14651306 database_id : str ,
@@ -1495,58 +1336,6 @@ def raw(
14951336
14961337 timeout: Override the client-level default timeout for this request, in seconds
14971338 """
1498- ...
1499-
1500- @overload
1501- def raw (
1502- self ,
1503- database_id : str ,
1504- * ,
1505- account_id : str ,
1506- body : Iterable [database_raw_params .MultipleQueriesBody ],
1507- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1508- # The extra values given here take precedence over values defined on the client or passed to this method.
1509- extra_headers : Headers | None = None ,
1510- extra_query : Query | None = None ,
1511- extra_body : Body | None = None ,
1512- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1513- ) -> AsyncPaginator [DatabaseRawResponse , AsyncSinglePage [DatabaseRawResponse ]]:
1514- """Returns the query result rows as arrays rather than objects.
1515-
1516- This is a
1517- performance-optimized version of the /query endpoint.
1518-
1519- Args:
1520- account_id: Account identifier tag.
1521-
1522- database_id: D1 database identifier (UUID).
1523-
1524- extra_headers: Send extra headers
1525-
1526- extra_query: Add additional query parameters to the request
1527-
1528- extra_body: Add additional JSON properties to the request
1529-
1530- timeout: Override the client-level default timeout for this request, in seconds
1531- """
1532- ...
1533-
1534- @required_args (["account_id" , "sql" ], ["account_id" , "body" ])
1535- def raw (
1536- self ,
1537- database_id : str ,
1538- * ,
1539- account_id : str ,
1540- sql : str | Omit = omit ,
1541- params : SequenceNotStr [str ] | Omit = omit ,
1542- body : Iterable [database_raw_params .MultipleQueriesBody ] | Omit = omit ,
1543- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1544- # The extra values given here take precedence over values defined on the client or passed to this method.
1545- extra_headers : Headers | None = None ,
1546- extra_query : Query | None = None ,
1547- extra_body : Body | None = None ,
1548- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
1549- ) -> AsyncPaginator [DatabaseRawResponse , AsyncSinglePage [DatabaseRawResponse ]]:
15501339 if not account_id :
15511340 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
15521341 if not database_id :
@@ -1558,7 +1347,6 @@ def raw(
15581347 {
15591348 "sql" : sql ,
15601349 "params" : params ,
1561- "body" : body ,
15621350 },
15631351 database_raw_params .DatabaseRawParams ,
15641352 ),
0 commit comments