mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
drop database #384
This commit is contained in:
@@ -77,6 +77,17 @@
|
||||
);
|
||||
};
|
||||
|
||||
const handleDropDatabase = () => {
|
||||
showModal(ConfirmModal, {
|
||||
message: `Really drop database ${name}? All opened sessions with this database will be forcefully closed.`,
|
||||
onConfirm: () =>
|
||||
apiCall('server-connections/drop-database', {
|
||||
conid: connection._id,
|
||||
name,
|
||||
}),
|
||||
});
|
||||
};
|
||||
|
||||
const handleNewCollection = () => {
|
||||
showModal(InputTextModal, {
|
||||
value: '',
|
||||
@@ -233,6 +244,9 @@
|
||||
{ onClick: handleNewQuery, text: 'New query', isNewQuery: true },
|
||||
driver?.databaseEngineTypes?.includes('sql') && { onClick: handleNewTable, text: 'New table' },
|
||||
driver?.databaseEngineTypes?.includes('document') && { onClick: handleNewCollection, text: 'New collection' },
|
||||
isSqlOrDoc &&
|
||||
!connection.isReadOnly &&
|
||||
!connection.singleDatabase && { onClick: handleDropDatabase, text: 'Drop database' },
|
||||
{ divider: true },
|
||||
isSqlOrDoc && !connection.isReadOnly && { onClick: handleImport, text: 'Import wizard' },
|
||||
isSqlOrDoc && { onClick: handleExport, text: 'Export wizard' },
|
||||
|
||||
Reference in New Issue
Block a user