Skip to content

Is attached#1194

Merged
belgattitude merged 5 commits into
mainfrom
is-attached
May 25, 2026
Merged

Is attached#1194
belgattitude merged 5 commits into
mainfrom
is-attached

Conversation

@belgattitude

@belgattitude belgattitude commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added isAttached() method to check if a database is currently attached.
    • Added getDatabases() method to retrieve information about attached databases with filtering options.
  • Chores

    • Updated dependencies across the monorepo for improved compatibility and security.
    • Upgraded Docker base images and Yarn package manager to latest stable versions.

Review Change Stack

@vercel

vercel Bot commented May 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flowblade-next-app Ready Ready Preview May 25, 2026 3:01pm

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@changeset-bot

changeset-bot Bot commented May 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 301a340

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@flowblade/sqlduck Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e206b4d5-897e-4e2e-8e9b-9559a036c877

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR extends DuckDatabaseManager with two new methods (isAttached and getDatabases) to query DuckDB's attached database catalog, adds corresponding test coverage with changesets for release metadata, and performs a comprehensive dependency update across the entire monorepo including Yarn runtime, development tools, and type definitions.

Changes

DuckDatabaseManager Feature and Dependency Updates

Layer / File(s) Summary
DuckDatabaseManager methods and test coverage
packages/sqlduck/src/manager/database/duck-database-manager.ts, packages/sqlduck/src/manager/database/duck-database-manager.test.ts, .changeset/deep-chefs-marry.md, .changeset/sharp-parents-rescue.md
isAttached(dbAlias) checks whether a database alias is present in the DuckDB catalog using duckdb_databases(), returning a boolean promise. getDatabases({ includeInternal }) lists attached database metadata with optional filtering. Tests validate both methods' return types and behavior. Changesets declare a patch version bump for isAttached and minor version bump for getDatabases.
Dependency version updates across monorepo
.yarnrc.yml, package.json, packages/*/package.json, examples/**/package.json, benchmark/package.json, docs/package.json, examples/apps/nextjs-app/docker/*
Yarn is upgraded from 4.14.1 to 4.15.0 with corresponding .yarnrc.yml catalog and npmPreapprovedPackages entries updated. Development dependencies are bumped across all packages: @dotenvx/dotenvx (1.66.0→1.67.0), @types/node (25.9.0→25.9.1), npm-run-all2 (9.0.0→9.0.1), valibot (1.4.0→1.4.1), and related tools. Docker base Node.js versions are updated (24.14/24.15→24.16) and Corepack version bumped (0.34.7→0.35.0).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • belgattitude/flowblade#1117: Refactors DuckDatabaseManager SQL execution via ManagerQueryExecutor, which provides the execution foundation used by the new isAttached and getDatabases methods added in this PR.

Poem

🐰 Databases now whisper their secrets clear,
With isAttached we know which ones are here,
And getDatabases shows the whole array,
While fresh dependencies keep code fresh today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Is attached' is partially related to the changeset—it refers to one of the two main features added (isAttached method), but does not capture the full scope of changes which also includes getDatabases method and multiple dependency updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch is-attached

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying flowblade with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2636a94
Status:🚫  Build failed.

View logs

@socket-security

socket-security Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm caniuse-lite is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/browserslist@4.28.2npm/next@16.2.6npm/caniuse-lite@1.0.30001791

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/caniuse-lite@1.0.30001791. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm caniuse-lite is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/browserslist@4.28.2npm/next@16.2.6npm/caniuse-lite@1.0.30001791

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/caniuse-lite@1.0.30001791. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm caniuse-lite is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/browserslist@4.28.2npm/next@16.2.6npm/caniuse-lite@1.0.30001791

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/caniuse-lite@1.0.30001791. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm caniuse-lite is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/browserslist@4.28.2npm/next@16.2.6npm/caniuse-lite@1.0.30001791

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/caniuse-lite@1.0.30001791. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm date-fns is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: examples/shared/base-ui/package.jsonnpm/date-fns@4.3.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/date-fns@4.3.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm es-abstract is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/@belgattitude/eslint-config-bases@8.15.0npm/regexp.escape@2.0.1npm/es-abstract@1.24.2

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/es-abstract@1.24.2. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm jiti is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/@commitlint/cli@21.0.1npm/jiti@2.6.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/jiti@2.6.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm markdown-it is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/typedoc@0.28.19npm/markdown-it@14.1.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/markdown-it@14.1.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/sqlduck/src/manager/database/duck-database-manager.test.ts (1)

89-104: ⚡ Quick win

Add a test for includeInternal: true branch.

The new method includes branching logic on includeInternal, but the new tests only validate the default path. Please add one case asserting internal DBs are included when includeInternal: true.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/sqlduck/src/manager/database/duck-database-manager.test.ts` around
lines 89 - 104, Add a new test case that calls DuckDatabaseManager.getDatabases
with includeInternal: true and asserts the returned list contains internal
databases; specifically, create a DuckDatabaseManager(conn), call await
dbManager.getDatabases({ includeInternal: true }), then assert at least one item
has internal: true (or that the array contains expected internal DB entries) and
its shape matches the existing expectation (fields like database_name,
database_oid, encrypted, readonly, type: 'duckdb'); place this as an it(...)
alongside the existing test to cover the includeInternal branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/sharp-parents-rescue.md:
- Line 5: The changeset note currently references the wrong API name; update the
text in .changeset/sharp-parents-rescue.md to use the actual public method name
getDatabases (exact casing) instead of getDuckdbDatabases so release notes
accurately reflect the added API; verify the rest of the note mentions the
correct symbol getDatabases and adjust any linked references or examples to
match.

---

Nitpick comments:
In `@packages/sqlduck/src/manager/database/duck-database-manager.test.ts`:
- Around line 89-104: Add a new test case that calls
DuckDatabaseManager.getDatabases with includeInternal: true and asserts the
returned list contains internal databases; specifically, create a
DuckDatabaseManager(conn), call await dbManager.getDatabases({ includeInternal:
true }), then assert at least one item has internal: true (or that the array
contains expected internal DB entries) and its shape matches the existing
expectation (fields like database_name, database_oid, encrypted, readonly, type:
'duckdb'); place this as an it(...) alongside the existing test to cover the
includeInternal branch.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 45a6b82b-b273-46ff-84ac-2c423edee022

📥 Commits

Reviewing files that changed from the base of the PR and between 46fc011 and 2636a94.

⛔ Files ignored due to path filters (2)
  • .yarn/releases/yarn-4.15.0.cjs is excluded by !**/.yarn/**
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (22)
  • .changeset/deep-chefs-marry.md
  • .changeset/sharp-parents-rescue.md
  • .yarnrc.yml
  • benchmark/package.json
  • docs/package.json
  • examples/apps/fastify-app/package.json
  • examples/apps/nextjs-app/docker/Dockerfile
  • examples/apps/nextjs-app/docker/Dockerfile.alpine
  • examples/apps/nextjs-app/package.json
  • examples/shared/base-auth/package.json
  • examples/shared/base-ui/package.json
  • examples/shared/db-sqlserver/package.json
  • examples/shared/duckb-openfoodfact/package.json
  • package.json
  • packages/core/package.json
  • packages/source-duckdb/package.json
  • packages/source-kysely/package.json
  • packages/sql-tag-format/package.json
  • packages/sql-tag/package.json
  • packages/sqlduck/package.json
  • packages/sqlduck/src/manager/database/duck-database-manager.test.ts
  • packages/sqlduck/src/manager/database/duck-database-manager.ts

"@flowblade/sqlduck": minor
---

Add getDuckdbDatabases

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use the actual API name in the changeset note.

getDuckdbDatabases does not match the added public method (getDatabases), so release notes will be misleading.

Suggested fix
-Add getDuckdbDatabases
+Add getDatabases
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Add getDuckdbDatabases
Add getDatabases
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/sharp-parents-rescue.md at line 5, The changeset note currently
references the wrong API name; update the text in
.changeset/sharp-parents-rescue.md to use the actual public method name
getDatabases (exact casing) instead of getDuckdbDatabases so release notes
accurately reflect the added API; verify the rest of the note mentions the
correct symbol getDatabases and adjust any linked references or examples to
match.

@pkg-pr-new

pkg-pr-new Bot commented May 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@flowblade/core

npm i https://pkg.pr.new/@flowblade/core@1194

@flowblade/source-duckdb

npm i https://pkg.pr.new/@flowblade/source-duckdb@1194

@flowblade/source-kysely

npm i https://pkg.pr.new/@flowblade/source-kysely@1194

@flowblade/sql-tag

npm i https://pkg.pr.new/@flowblade/sql-tag@1194

@flowblade/sql-tag-format

npm i https://pkg.pr.new/@flowblade/sql-tag-format@1194

@flowblade/sqlduck

npm i https://pkg.pr.new/@flowblade/sqlduck@1194

commit: 301a340

@belgattitude
belgattitude merged commit fe44a0c into main May 25, 2026
16 checks passed
@belgattitude
belgattitude deleted the is-attached branch May 25, 2026 21:40
@belgattitude belgattitude mentioned this pull request May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant