mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-23 04:36:00 +00:00
drop database #384
This commit is contained in:
@@ -276,6 +276,11 @@ const driver = {
|
||||
await db.createCollection('collection1');
|
||||
},
|
||||
|
||||
async dropDatabase(pool, name) {
|
||||
const db = pool.db(name);
|
||||
await db.dropDatabase();
|
||||
},
|
||||
|
||||
async loadFieldValues(pool, name, field, search) {
|
||||
try {
|
||||
const collection = pool.__getDatabase().collection(name.pureName);
|
||||
|
||||
@@ -16,6 +16,16 @@ class MsSqlDumper extends SqlDumper {
|
||||
}
|
||||
}
|
||||
|
||||
dropDatabase(name) {
|
||||
this.putCmd(
|
||||
`USE master;
|
||||
ALTER DATABASE %i SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
|
||||
DROP DATABASE %i`,
|
||||
name,
|
||||
name
|
||||
);
|
||||
}
|
||||
|
||||
autoIncrement() {
|
||||
this.put(' ^identity');
|
||||
}
|
||||
|
||||
@@ -26,6 +26,10 @@ class Dumper extends SqlDumper {
|
||||
}
|
||||
}
|
||||
|
||||
dropDatabase(name) {
|
||||
this.putCmd('^drop ^database %i ^with(^force)', name);
|
||||
}
|
||||
|
||||
dropRecreatedTempTable(tmptable) {
|
||||
this.putCmd('^drop ^table %i ^cascade', tmptable);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user