feat: initialize backend database service architecture and implement frontend schema explorer components

This commit is contained in:
Ümit Tunç
2026-04-24 07:31:24 +03:00
parent ce67df1067
commit bf3d05ea97
13 changed files with 366 additions and 71 deletions
+5 -5
View File
@@ -6,7 +6,7 @@ const api = axios.create({
});
api.interceptors.request.use((config) => {
const connection = useAppStore.getState().connection;
const { connection, activeDatabase } = useAppStore.getState();
if (connection) {
config.params = {
...config.params,
@@ -14,7 +14,7 @@ api.interceptors.request.use((config) => {
username: connection.username,
password: connection.password,
port: connection.port,
database: connection.database || config.params?.database,
database: config.params?.database || activeDatabase || connection.database,
};
}
return config;
@@ -24,7 +24,7 @@ export default api;
export const SchemaService = {
getDatabases: () => api.get('/schema/databases'),
getTables: (db: string) => api.get(`/schema/tables/${db}`),
getTableSchema: (table: string) => api.get(`/schema/${table}`),
getTableData: (table: string, database?: string) => api.get(`/schema/${table}/data`, { params: { database } }),
getTables: (db: string) => api.get(`/schema/tables/${db}`, { params: { database: db } }),
getTableSchema: (table: string, database?: string) => api.get(`/schema/${table}`, { params: { database } }),
getTableData: (table: string, params: any) => api.get(`/schema/${table}/data`, { params }),
};