Skip to content

Fix PriorityQueue reopening existing databases#11

Open
MrQinlala wants to merge 1 commit into
goptics:mainfrom
MrQinlala:codex/fix-sqliteq-priority-reopen
Open

Fix PriorityQueue reopening existing databases#11
MrQinlala wants to merge 1 commit into
goptics:mainfrom
MrQinlala:codex/fix-sqliteq-priority-reopen

Conversation

@MrQinlala

Copy link
Copy Markdown

Summary

  • fix PriorityQueue initialization so it scans every PRAGMA table_info row before deciding whether the priority column exists
  • keep creating the priority index with CREATE INDEX IF NOT EXISTS
  • add a regression test for reopening an existing persisted priority queue database

Testing

go test ./... -run TestPriorityQueueReopenExistingDB -count=1
go test ./... -count=1

Both passed locally on Windows with Go 1.26.4 and GCC 14.1.0.

Fixes #5.

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.52174% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
priority_queue.go 56.52% 5 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@fahimfaisaal

Copy link
Copy Markdown
Member

Hi @MrQinlala Thanks for the PR.

Can you fix the codecov as well?

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.

PriorityQueue cannot reopen an existing DB: 'duplicate column name: priority'

2 participants