Giter Club home page Giter Club logo

nebula-console's Introduction

Nebula Graph Console

This repository contains the Nebula Graph Console for Nebula Graph 2.0.

Features

  • Supports interactive and non-interactive mode.
  • Supports viewing the history statements.
  • Supports autocompletion.
  • Supports multiple OS and architecture (We recommend Linux/AMD64).

Build Nebula Graph Console

To build Nebula Graph Console, make sure that you have installed Go.

Run the following command to examine if Go is installed on your machine.

$ go version

Use Git to clone the source code of Nebula Graph to your host.

$ git clone [email protected]:vesoft-inc/nebula-console.git

Run the following command to build Nebula Graph Console.

$ cd nebula-console
$ make

Connect to Nebula Graph Console

To connect your Nebula Graph services with the Nebula Graph Console, use the following command.

$ ./nebula-console -addr <ip> -port <port> -u <username> -p <password>
    [-t 120] [-e "nGQL_statement" | -f filename.nGQL]
Option Description
-h Shows the help menu.
-addr Sets the IP address of the graphd service. The default address is 127.0.0.1.
-port Sets the port number of the graphd service. The default port number is 3699.
-u/-user Sets the username of your Nebula Graph account. The default username is root.
-p/-password Sets the password of your Nebula Graph account. The default password for the root user is nebula.
-t/-timeout Sets an integer-type timeout threshold for the connection. The unit is second. The default value is 120.
-e/-eval Sets a string-type nGQL statement. The nGQL statement is executed once the connection succeeds. The connection stops after the result is returned.
-f/-file Sets the path of an nGQL file. The nGQL statements in the file are executed once the connection succeeds. You'll get the return messages and the connection stops then.

Check options for ./nebula-console -h, try ./nebula-console in interactive mode directly. And try ./nebula-console -e 'show hosts' for the direct script mode. And try ./nebula-console -f demo.nGQL for the script file mode.

Export mode for Nebula Graph Console

When the export mode is enabled, Nebula Graph Console exports all the query results into a CSV file. When the export mode is disabled, the export stops. The syntax is as follows.

NOTE: The following commands are case insensitive.

  • Enable nebula-console export mode:
nebula> :SET CSV <your_file.csv>
  • Disable nebula-console export mode:
nebula> :UNSET CSV

Disconnect Nebula Graph Console from Nebula Graph

You can use :EXIT or :QUIT to disconnect from Nebula Graph. For convenience, nebula-console supports using these commands in lower case without the colon (":"), such as quit.

nebula> :QUIT

Bye root!

nebula> :EXIT

Bye root!

nebula> quit

Bye root!

nebula> exit

Bye root!

Keyboard Shortcuts

Key Binding Description
Ctrl-A, Home Move cursor to beginning of line
Ctrl-E, End Move cursor to end of line
Ctrl-B, Left Move cursor one character left
Ctrl-F, Right Move cursor one character right
Ctrl-Left, Alt-B Move cursor to previous word
Ctrl-Right, Alt-F Move cursor to next word
Ctrl-D, Del (if line is not empty) Delete character under cursor
Ctrl-D (if line is empty) End of File --- quit from the console
Ctrl-C Reset input (create new empty prompt)
Ctrl-L Clear screen (line is unmodified)
Ctrl-T Transpose previous character with current character
Ctrl-H, BackSpace Delete character before cursor
Ctrl-W, Alt-BackSpace Delete word leading up to cursor
Alt-D Delete word following cursor
Ctrl-K Delete from cursor to end of line
Ctrl-U Delete from start of line to cursor
Ctrl-P, Up Previous match from history
Ctrl-N, Down Next match from history
Ctrl-R Reverse Search history (Ctrl-S forward, Ctrl-G cancel)
Ctrl-Y Paste from Yank buffer (Alt-Y to paste next yank instead)
Tab Next completion
Shift-Tab (after Tab) Previous completion

TODO

  • CI/CD
  • package to RPM/DEB/DOCKER
  • batch process to reduce memory consumption and speed up IO

nebula-console's People

Contributors

amber1990zhang avatar cpwstatic avatar dutor avatar jievince avatar shylock-hg avatar yixinglu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.