nexusql 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -3155,6 +3155,12 @@ var Database = class _Database {
3155
3155
  * Drop a database if it exists.
3156
3156
  */
3157
3157
  async dropDatabase(name) {
3158
+ await this.exec(`
3159
+ SELECT pg_terminate_backend(pg_stat_activity.pid)
3160
+ FROM pg_stat_activity
3161
+ WHERE pg_stat_activity.datname = '${name}'
3162
+ AND pid <> pg_backend_pid();
3163
+ `);
3158
3164
  await this.exec(`DROP DATABASE IF EXISTS "${name}";`);
3159
3165
  }
3160
3166
  /**