@flowblade/sqlduck 0.20.0 → 0.22.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/index.d.mts CHANGED
@@ -320,8 +320,14 @@ declare class DuckDatabaseManager {
320
320
  * Get the currently attached database names
321
321
  */
322
322
  showDatabases: () => Promise<Record<string, unknown>[]>;
323
+ /**
324
+ * @throws Error if the database isn't attached
325
+ */
323
326
  detach: (dbAlias: string) => Promise<boolean>;
324
- detachIfExists: (dbAlias: string) => Promise<boolean>;
327
+ /**
328
+ * @todo DETACH IF EXISTS is not supported in DuckDB as of v1.5.3
329
+ */
330
+ detachOrIgnore: (dbAlias: string) => Promise<boolean>;
325
331
  /**
326
332
  * The statistics recomputed by the ANALYZE statement are only used for join order optimization.
327
333
  *
package/dist/index.mjs CHANGED
@@ -498,14 +498,24 @@ var DuckDatabaseManager = class {
498
498
  showDatabases = async () => {
499
499
  return await this.#executor.getRowObjectsJS("showDatabases()", `SHOW DATABASES`);
500
500
  };
501
+ /**
502
+ * @throws Error if the database isn't attached
503
+ */
501
504
  detach = async (dbAlias) => {
502
505
  assertValidAliasName(dbAlias);
503
506
  await this.#executor.getRowObjectsJS(`detach(${dbAlias})`, `DETACH ${dbAlias}`);
504
507
  return true;
505
508
  };
506
- detachIfExists = async (dbAlias) => {
509
+ /**
510
+ * @todo DETACH IF EXISTS is not supported in DuckDB as of v1.5.3
511
+ */
512
+ detachOrIgnore = async (dbAlias) => {
507
513
  assertValidAliasName(dbAlias);
508
- await this.#executor.getRowObjectsJS(`detachIfExists(${dbAlias})`, `DETACH IF EXISTS ${dbAlias}`);
514
+ try {
515
+ await this.detach(dbAlias);
516
+ } catch {
517
+ return false;
518
+ }
509
519
  return true;
510
520
  };
511
521
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowblade/sqlduck",
3
- "version": "0.20.0",
3
+ "version": "0.22.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@flowblade/core": "^0.2.29",
60
- "@flowblade/source-duckdb": "^0.21.0",
60
+ "@flowblade/source-duckdb": "^0.22.0",
61
61
  "@flowblade/sql-tag": "^0.3.4",
62
62
  "@httpx/assert": "^0.17.1",
63
63
  "@httpx/dsn-parser": "^1.9.11",
@@ -69,7 +69,7 @@
69
69
  "zod": "^4.4.3"
70
70
  },
71
71
  "peerDependencies": {
72
- "@duckdb/node-api": "^1.5.3-r.1",
72
+ "@duckdb/node-api": "^1.5.3-r.2",
73
73
  "valibot": "^1.3.1"
74
74
  },
75
75
  "peerDependenciesMeta": {
@@ -79,8 +79,8 @@
79
79
  },
80
80
  "devDependencies": {
81
81
  "@belgattitude/eslint-config-bases": "8.15.0",
82
- "@dotenvx/dotenvx": "1.67.0",
83
- "@duckdb/node-api": "1.5.3-r.1",
82
+ "@dotenvx/dotenvx": "1.68.0",
83
+ "@duckdb/node-api": "1.5.3-r.2",
84
84
  "@faker-js/faker": "10.4.0",
85
85
  "@flowblade/source-kysely": "^1.4.1",
86
86
  "@httpx/assert": "0.17.1",
@@ -90,9 +90,9 @@
90
90
  "@testcontainers/mssqlserver": "12.0.0",
91
91
  "@total-typescript/ts-reset": "0.6.1",
92
92
  "@types/node": "25.9.1",
93
- "@typescript-eslint/eslint-plugin": "8.59.4",
94
- "@typescript-eslint/parser": "8.59.4",
95
- "@typescript/native-preview": "7.0.0-dev.20260523.1",
93
+ "@typescript-eslint/eslint-plugin": "8.60.0",
94
+ "@typescript-eslint/parser": "8.60.0",
95
+ "@typescript/native-preview": "7.0.0-dev.20260524.1",
96
96
  "@vitest/coverage-v8": "4.1.7",
97
97
  "@vitest/ui": "4.1.7",
98
98
  "ansis": "4.3.0",