drop database #384

This commit is contained in:
Jan Prochazka
2022-09-29 09:58:35 +02:00
parent 04d39f6646
commit 833f029ab5
9 changed files with 62 additions and 7 deletions

View File

@@ -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);

View File

@@ -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');
}

View File

@@ -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);
}