Skip to content

Conversation

@hrl20
Copy link
Collaborator

@hrl20 hrl20 commented Jun 26, 2025

Summary

  • Replace HasSetMotherDuckToken with Initialized flag and mutex for thread safety
  • Wrap initialization logic in !d.Initialized check to prevent duplicate execution
  • Update tests to use new Initialized field

Test plan

  • Run go test -v ./pkg/plugin to verify all tests pass
  • Verify initialization queries (extensions, directories, MotherDuck token) only execute once per driver instance
  • Confirm thread safety with mutex protection around initialization logic

🤖 Generated with Claude Code

- Replace HasSetMotherDuckToken with Initialized flag and mutex for thread safety
- Wrap initialization logic in \!d.Initialized check to prevent duplicate execution
- Update tests to use new Initialized field

This prevents redundant execution of extension installation, directory setup,
and MotherDuck token configuration across multiple connections.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@hrl20 hrl20 requested a review from elefeint June 26, 2025 04:10
if err != nil {
return err
for _, query := range bootQueries {
// TODO: Fix context cancellation happening somewhere in the plugin.

Choose a reason for hiding this comment

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

todo for this PR or for future reference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for future reference!

@hrl20 hrl20 merged commit 1216ad1 into main Jun 26, 2025
15 checks passed
@hrl20 hrl20 mentioned this pull request Jun 26, 2025
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.

3 participants