Beispiel #1
0
        public async Task DoREPL(string connectionName, ConnectionType connectionType)
        {
            _console.CancelKeyPress += HandleCancelKeyPress;

            bool connected = await TestConnection(connectionName, connectionType);

            if (connected)
            {
                _console.WriteLine(startupMsg);
                _console.WriteLine(_currentExecutor.RemoteMessage);
                _console.WriteLine();

                try
                {
                    await DoREPLLoop();
                }

                catch (Exception ex)
                {
                    _console.WriteLine(ex);
                }
                finally
                {
                    _console.WriteLine("Quitting.");
                    _connection.Dispose();
                }
            }
        }
Beispiel #2
0
        public async Task <int> ExecuteQuery(string query, string connectionName, ConnectionType queryExecutor)
        {
            _console.WriteLine($"Execution Query: {query} on {connectionName} using {queryExecutor}");
            var exec = await _connectionManager.Open(connectionName, queryExecutor);

            var results = await exec.ExecuteQuery <dynamic>(query);

            _console.WriteLine(results.Message);
            _console.Dump(results);
            return(0);
        }