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 +6 -0
- package/dist/cli.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1793,6 +1793,12 @@ var Database = class _Database {
|
|
|
1793
1793
|
* Drop a database if it exists.
|
|
1794
1794
|
*/
|
|
1795
1795
|
async dropDatabase(name) {
|
|
1796
|
+
await this.exec(`
|
|
1797
|
+
SELECT pg_terminate_backend(pg_stat_activity.pid)
|
|
1798
|
+
FROM pg_stat_activity
|
|
1799
|
+
WHERE pg_stat_activity.datname = '${name}'
|
|
1800
|
+
AND pid <> pg_backend_pid();
|
|
1801
|
+
`);
|
|
1796
1802
|
await this.exec(`DROP DATABASE IF EXISTS "${name}";`);
|
|
1797
1803
|
}
|
|
1798
1804
|
/**
|