Skip to content

Commit

Permalink
mssqlcliclient: When connecting, respect connected_database (dbcli#256
Browse files Browse the repository at this point in the history
)
  • Loading branch information
detule authored and pensivebrian committed Aug 9, 2019
1 parent be187af commit d697935
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mssqlcli/mssqlcliclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def __init__(self, mssqlcli_options, sql_tools_client, owner_uri=None, **kwargs)
self.password = mssqlcli_options.password
self.authentication_type = u'Integrated' if mssqlcli_options.integrated_auth else u'SqlLogin'
self.database = mssqlcli_options.database
self.connected_database = None
self.encrypt = mssqlcli_options.encrypt
self.trust_server_certificate = mssqlcli_options.trust_server_certificate
self.connection_timeout = mssqlcli_options.connection_timeout
Expand All @@ -55,7 +56,7 @@ def __init__(self, mssqlcli_options, sql_tools_client, owner_uri=None, **kwargs)

def get_base_connection_params(self):
return {u'ServerName': self.server_name,
u'DatabaseName': self.database,
u'DatabaseName': self.connected_database if self.connected_database else self.database,
u'UserName': self.user_name,
u'Password': self.password,
u'AuthenticationType': self.authentication_type,
Expand Down

0 comments on commit d697935

Please sign in to comment.