modified: backend/.env.example
new file: backend/src/controllers/sqlInterfaceController.ts new file: backend/src/routes/sqlInterface.ts modified: backend/src/server.ts modified: docker-compose.external-db.yml modified: frontend/src/App.tsx modified: frontend/src/components/Sidebar.tsx new file: frontend/src/pages/SqlInterface.tsx modified: frontend/src/services/api.ts
This commit is contained in:
@@ -168,4 +168,23 @@ export const databasesApi = {
|
||||
api.get<{ schema: any[] }>(`/databases/${databaseId}/tables/${tableName}/schema`),
|
||||
};
|
||||
|
||||
// SQL Interface API
|
||||
export interface SqlQueryResult {
|
||||
success: boolean;
|
||||
data?: any[];
|
||||
rowCount?: number;
|
||||
fields?: { name: string; dataTypeID: number }[];
|
||||
executionTime?: number;
|
||||
command?: string;
|
||||
error?: string;
|
||||
position?: number;
|
||||
detail?: string;
|
||||
hint?: string;
|
||||
}
|
||||
|
||||
export const sqlInterfaceApi = {
|
||||
execute: (databaseId: string, query: string) =>
|
||||
api.post<SqlQueryResult>('/sql/execute', { database_id: databaseId, query }),
|
||||
};
|
||||
|
||||
export default api;
|
||||
|
||||
Reference in New Issue
Block a user