-
Notifications
You must be signed in to change notification settings - Fork 65
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
Set default username for SQL client connections #2397
Comments
Proposal: Define default usernames for client connectionsSummaryDefine default usernames to be used on client initialization in the Ballerina SQL connector modules. HistoryThe 1.3.x versions and below of the SQL connector modules defaulted to connecting to the database without a username Goals
MotivationThe ability to connect to common databases with default credentials (as opposed to manually defining) would make the DescriptionModify the client initialization method in all the current SQL connector modules to use a default value for the username For example, in MySQL (default username is public isolated function init(
string host = "localhost", string? user = "root", string? password = (), string? database = (), int port = 3306,
Options? options = (), sql:ConnectionPool? connectionPool = ()
) returns sql:Error? The default usernames used for each module would be as follows.
References[1] https://dev.mysql.com/doc/refman/8.0/en/default-privileges.html |
Removing optionality from the user param type remains the same, we only pass default user instead of nil |
@daneshk +1 updated the proposal |
Looks good to me. @niveathika please check |
LGTM. @kaneeldias From next proposal let's open a new issue for the proposal. As the improvement issue and the proposal has different life cycle. |
Description:
Currently, the default behaviour of the client is to connect to the databases without any username attached. Should this be changed so that the default user of each database should be used for the connection.
For instance MySQL its root, oracle its XA
This needs to be looked into since usually the default user can have higher privileges.
The text was updated successfully, but these errors were encountered: