Added get_database_tables endpoint.

This commit is contained in:
2025-04-10 15:08:27 +03:00
parent 6a26174b08
commit c07e03cf93
2 changed files with 13 additions and 0 deletions

View File

@@ -85,6 +85,16 @@ async def fetch_cursor(
)
@router.get(
"/get_database_tables", dependencies=[Depends(get_current_user)], status_code=200
)
async def get_database_tables(connection_id:int):
pool = mysql.pools.get(connection_id, None)
r = await mysql.get_tables_and_datatypes(pool=pool)
print(r)
return r
@router.get(
"/sse-stream-cursor", dependencies=[Depends(get_current_user)], status_code=200
)
@@ -142,6 +152,8 @@ async def websocket_stream_cursor(
await websocket.close(reason="Done")
@router.websocket("/databases_changes")
async def websocket_endpoint(
websocket: WebSocket,