File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
sqlit/domains/connections/providers/d1 Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,8 @@ def get_databases(self, conn: D1Connection) -> list[str]:
125125 return [db ["name" ] for db in databases if "name" in db ]
126126
127127 def _execute (self , conn : D1Connection , query : str ) -> dict [str , Any ]:
128- """Internal method to run a command on the D1 execute endpoint."""
129- api_url = f"{ self ._api_base_url ()} /client/v4/accounts/{ conn .account_id } /d1/database/{ conn .database_id } /execute "
128+ """Internal method to run a command on the D1 query endpoint."""
129+ api_url = f"{ self ._api_base_url ()} /client/v4/accounts/{ conn .account_id } /d1/database/{ conn .database_id } /query "
130130 response = conn .session .post (api_url , json = {"sql" : query })
131131 response .raise_for_status ()
132132 # The result is a list containing a single result object
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ def create_database(self, name: str) -> None:
6363 def execute (self , db_name : str , sql : str ) -> dict | None :
6464 payload = self ._request (
6565 "POST" ,
66- f"/client/v4/accounts/{ self ._account_id } /d1/database/{ db_name } /execute " ,
66+ f"/client/v4/accounts/{ self ._account_id } /d1/database/{ db_name } /query " ,
6767 {"sql" : sql },
6868 )
6969 if not payload .get ("success" , False ):
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
1414 }
1515
1616 const execMatch = path . match (
17- / ^ \/ c l i e n t \/ v 4 \/ a c c o u n t s \/ ( [ ^ / ] + ) \/ d 1 \/ d a t a b a s e \/ ( [ ^ / ] + ) \/ e x e c u t e $ /
17+ / ^ \/ c l i e n t \/ v 4 \/ a c c o u n t s \/ ( [ ^ / ] + ) \/ d 1 \/ d a t a b a s e \/ ( [ ^ / ] + ) \/ q u e r y $ /
1818 ) ;
1919 if ( execMatch && request . method === "POST" ) {
2020 let body ;
You can’t perform that action at this time.
0 commit comments