Skip to content

feat(sql): add base sql/driver wrappers#1281

Merged
giortzisg merged 4 commits into
masterfrom
feat/sql
May 26, 2026
Merged

feat(sql): add base sql/driver wrappers#1281
giortzisg merged 4 commits into
masterfrom
feat/sql

Conversation

@giortzisg
Copy link
Copy Markdown
Contributor

@giortzisg giortzisg commented Apr 24, 2026

Description

This PR adds the base passthrough wrappers for database/sql/driver and the public API . Instrumentation will be added in a follow-up PR.

The core design is for sentryConn to always expose context-aware interfaces. Then each method delegates to the underlying driver implementation. For legacy drivers the wrapper falls back to the non-context methods. This way we can correctly instrument the legacy drivers as well with the correct context.

#skip-changelog

Issues

Changelog Entry Instructions

To add a custom changelog entry, uncomment the section above. Supports:

  • Single entry: just write text
  • Multiple entries: use bullet points
  • Nested bullets: indent 4+ spaces

For more details: custom changelog entries

Reminders

@giortzisg giortzisg self-assigned this Apr 24, 2026
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 24, 2026

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3f8f67c. Configure here.

Comment thread sql/stmt.go
Comment thread sql/conn.go
Comment thread sql/conn.go
Comment on lines +63 to +67
select {
default:
case <-ctx.Done():
return nil, ctx.Err()
}
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.

Honestly this is useless, it just guards whenever the cancel is called before we call the ex.Exec(). If it's already passed, then it won't be canceled at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not completely useless, but I get your point

Comment thread sql/conn.go
Comment thread sql/stmt.go
Comment thread sql/sentrysql.go
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@giortzisg giortzisg requested a review from sl0thentr0py May 21, 2026 09:31
@giortzisg giortzisg merged commit eb909d1 into master May 26, 2026
20 checks passed
@giortzisg giortzisg deleted the feat/sql branch May 26, 2026 09:25
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.

feat(sql): implement sentrysql sub-module with passthrough driver wrappers

3 participants