@persql/sdk 1.4.0 → 1.4.1

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
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  PerSQL
4
- } from "./chunk-5ELQCDXS.js";
4
+ } from "./chunk-HTQP2S7I.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import { writeFile } from "fs/promises";
package/dist/index.cjs CHANGED
@@ -604,6 +604,16 @@ var PerSQLDatabases = class {
604
604
  }
605
605
  return { data: body.data ?? [], nextCursor: body.nextCursor ?? null };
606
606
  }
607
+ /** Delete a database by slug. Requires an admin-role unscoped token. */
608
+ async delete(slug) {
609
+ if (this.client.local) {
610
+ throw new Error("PerSQL: databases.delete() needs a server-mode token.");
611
+ }
612
+ return this.client.request(
613
+ "DELETE",
614
+ `/v1/databases/${encodeURIComponent(slug)}`
615
+ );
616
+ }
607
617
  };
608
618
  var PerSQLDatabase = class {
609
619
  constructor(client, namespace, slug) {