Skip to content

sqlite: validate backup() source is a DatabaseSync - #66797

Open
araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-backup-type-check
Open

araujogui wants to merge 1 commit into
nodejs:mainfrom
araujogui:sqlite-backup-type-check

Conversation

@araujogui

Copy link
Copy Markdown
Member

backup() cast any BaseObject to Database*, so passing a StatementSync or Session caused a type confusion. It now checks HasInstance() against the DatabaseSync template.

Copilot AI balanced review requested due to automatic review settings October 16, 2026 18:30
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Oct 16, 2026
backup() only checked that the source argument was a BaseObject before
casting it to Database, so passing a Statement or Session caused a
type confusion. Check against the DatabaseSync constructor template
instead.

Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
@araujogui
araujogui force-pushed the sqlite-backup-type-check branch from 3b9b0f3 to 66f69bb Compare October 16, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants