feat: implement MySQL driver and schema discovery service for dynamic database management
This commit is contained in:
@@ -116,7 +116,7 @@ const MainContent: React.FC = () => {
|
||||
// For now, we'll use the existing SQL export for 'sql'
|
||||
// and implement a client-side CSV export for 'csv' since we have the rows
|
||||
if (format === 'sql') {
|
||||
const response = await SchemaService.exportDatabase(activeDatabase, activeTable);
|
||||
const response = await SchemaService.exportDatabase(activeDatabase, activeTable, filterModel.items);
|
||||
const url = window.URL.createObjectURL(new Blob([response.data]));
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
|
||||
@@ -36,7 +36,11 @@ export const SchemaService = {
|
||||
bulkAction: (data: { tables: string[], action: string, database: string }) => api.post('/schema/bulk-action', data),
|
||||
batchUpdate: (table: string, changes: any[]) => api.post(`/schema/${table}/batch-update`, { changes }),
|
||||
executeQuery: (query: string) => api.post('/schema/execute', { query }),
|
||||
exportDatabase: (database?: string, table?: string) => api.post('/schema/export', { database, table }, { responseType: 'blob' }),
|
||||
exportDatabase: (database?: string, table?: string, filters?: any) => api.post('/schema/export', {
|
||||
database,
|
||||
table,
|
||||
filters: filters ? JSON.stringify(filters) : undefined
|
||||
}, { responseType: 'blob' }),
|
||||
importDatabase: (formData: FormData) => api.post('/schema/import', formData, {
|
||||
headers: { 'Content-Type': 'multipart/form-data' }
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user