dbcli / mssql-cli Goto Github PK
View Code? Open in Web Editor NEWA command-line client for SQL Server with auto-completion and syntax highlighting
License: BSD 3-Clause "New" or "Revised" License
A command-line client for SQL Server with auto-completion and syntax highlighting
License: BSD 3-Clause "New" or "Revised" License
Using the -I option should use integrated auth, which should use the current users credentials and not prompt.
I tried this on my Mac laptop with MSSql-Server running in a docker container.
I get the following error:
(mssql-cli) ↪ mssql-cli -h localhost:1433 -U SA -W
Password:
Connection did not succeed.
Error message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)
Other messages: System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught) ---> System.AggregateException: One or more errors occurred. (Device not configured) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: Device not configured
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.ResolveCallback(Object context)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.SqlClient.SNI.SNITCPHandle.<ConnectAsync>d__22.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait(TimeSpan timeout)
at System.Data.SqlClient.SNI.SNITCPHandle..ctor(String serverName, Int32 port, Int64 timerExpire, Object callbackObject, Boolean parallel)
---> (Inner Exception #0) System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (0x00000005): Device not configured
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.ResolveCallback(Object context)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Data.SqlClient.SNI.SNITCPHandle.<ConnectAsync>d__22.MoveNext()<---
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.<>c__DisplayClass22_0.<TryGetConnection>b__0(Task`1 _)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection.ReliableSqlConnection.<>c__DisplayClass28_0.<<OpenAsync>b__0>d.MoveNext() in D:\repos\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Connection\ReliableConnection\ReliableSqlConnection.cs:line 298
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.SqlTools.ServiceLayer.Connection.ConnectionService.<TryOpenConnection>d__44.MoveNext() in D:\repos\sqltoolsservice\src\Microsoft.SqlTools.ServiceLayer\Connection\ConnectionService.cs:line 514
ClientConnectionId:00000000-0000-0000-0000-000000000000
Unable to connect. Please try again
The client is installed from source using pip install -e .
.
if Python.h file not found need to install python3-dev package
Looking to do after smart-completion is complete, 2nd or 3rd week of January https://microsoft.sharepoint.com/teams/Channel9/Pages/Calendar.aspx to book time.
Set up:
Hi, it seems MANIFEST.in
is missing some files:
/tests
(/test is included by defauls)/sqltoolsservice
/utility.py
/dos2unix.py
/build.py
I'd suggest to move these Python scripts to a separate package, for example utility.py
will be installed to /usr/lib/python3.6/site-packages/utility.py
...
Threat model
For auto-completion history, set a cutoff for certain size.
Integrate app insights python package to instrument key events.
Not sure if this is a toolsservice issue, but issuing the following statement:
Create Schema [Sampl
causes the tool to hang.
Certain OS versions of Mac have a lower version six preinstalled. During install Pip will try to uninstall the current version to install our updated one. This is not permitted and will result in a failed installation.
Investigate if we can either remove the dependency or downgrade.
Specifically updating:
mssql-cli logs
sqltoolsservice logs
command line parameters to both
This test fails on windows OS as the directory is created by it instead of raising an OSError exception.
Highlights with proper SQL Server syntax
I installed mssql-server and launched it in a separate window.
I installed the mssql-cli from git using pip install -e .
and then ran python dev_setup.py
from the project root.
When I launch mssql-cli and type in a password I get the following error:
[~/D/c/p/mssql-cli] (master|…)
(mssql-cli) ↪ mssql-cli
Password:
Connection did not succeed.Can't convert 'NoneType' object to str implicitly
Here is a traceback from the log file:
Traceback (most recent call last):
File "/home/amjith/Dropbox/code/python/mssql-cli/mssqlcli/main.py", line 291, in connect
if not self.mssqlcliclient_query_execution.connect():
File "/home/amjith/Dropbox/code/python/mssql-cli/mssqlcli/mssqlcliclient.py", line 71, in connect
response = connectionservice.handle_connection_response(response)
File "/home/amjith/Dropbox/code/python/mssql-cli/mssqlcli/jsonrpc/contracts/connectionservice.py", line
156, in handle_connection_response
return response_handlers[response_name](response)
File "/home/amjith/Dropbox/code/python/mssql-cli/mssqlcli/jsonrpc/contracts/connectionservice.py", line
138, in handle_connection_complete_notification
sys.stderr.write(u'\nError message: ' + response.error_message)
TypeError: Can't convert 'NoneType' object to str implicitly
I'm trying this out on Fedora Linux.
Python 3.5.4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.