-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add function to get the driver name #1591
Conversation
Warning Rate Limit Exceeded@demoManito has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 45 minutes and 14 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent update enhances the codebase by introducing a new function, Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
driver_test.go (1)
Line range hint
1495-1497
: Ensure TLS configuration specifies a minimum version.The TLS configuration used in the test setup does not specify a minimum version, which could potentially allow connections using older, less secure versions of TLS. It's recommended to set the minimum TLS version to TLS 1.3 to ensure better security. Here's a suggested change:
- tls.Config{ InsecureSkipVerify: true } + tls.Config{ InsecureSkipVerify: true, MinVersion: tls.VersionTLS13 }
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- driver.go (1 hunks)
- driver_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- driver.go
Additional comments not posted (3)
driver_test.go (3)
3356-3361
: The test for verifying the driver name is correctly implemented.
Line range hint
3362-3373
: The test for creating a new connector and checking database connectivity is correctly implemented.
Line range hint
3374-3408
: The test for handling timeouts during connector opening is correctly implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
driver_test.go (1)
Line range hint
1495-1497
: Ensure TLS configuration specifies a minimum version.The TLS configuration used in the test setup does not specify a minimum version. It's recommended to set the minimum TLS version to TLS 1.3 to ensure stronger security. Here's the suggested change:
- tls.Config{ InsecureSkipVerify: true } + tls.Config{ InsecureSkipVerify: true, MinVersion: tls.VersionTLS13 }
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- driver_test.go (1 hunks)
Additional comments not posted (3)
driver_test.go (3)
3356-3361
: This test for the driver name is correctly implemented.
Line range hint
3362-3375
: The test for creating a new connector and establishing a database connection is correctly implemented.
Line range hint
3376-3408
: The test for connector timeouts during connection opening is correctly implemented.
Please provide background information when you are proposing some new API. Why do you need it? |
hello @methane Why do you need it?When we create a link every time we need to enter it manually (for example: Use cases?Use Any other drivers provide it?These are some Java drivers that can get the driver name. Golang drivers rarely expose drivers. |
And |
Why And if it is common requirements, any preceding driver implement it? |
Drivers in other languages have functions to obtain the provided driver name. Why only focus on the go language? Would providing a function to get the default driver name cause any ill effects? |
Because they don't use database/sql. This problem is tightly coupled with database/sql design.
Any one public API has maintenance cost. We cannot remove or change its signature until v2. |
If the driver is registered via an alternate name, the developer who builds the program is aware of it and can provide it to anyone who needs it. We don't need to expose that flawed API in the driver. By the way, it is also possible:
The proposed API doesn't handle those cases. So I'm completely opposed to that change. Disclaimer: I'm the author patch #1499 that allows to change the driver name |
Description
Used to get the current driver name
Checklist