Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

The Crate Data Shell

Project Description

Crash


Crash is an interactive CrateDB command line interface (CLI) SQL shell with autocompletion.

Screenshot

Prerequisites

Recent versions of Crash require Python (>= 2.7) to run.

Use Crash 0.16.0 if you’re running Python 2.6.

Installation

As a Python Package

Crash is available as a pip package.

To install, run:

$ pip install crash

Now, run it:

$ crash

To update, run:

$ pip install -U crash

Standalone

Crash is also available as a standalone executable that includes all the necessary dependencies, and can be run as long as Python (>= 2.7) is available.

First, download the executable:

$ curl -o crash https://cdn.crate.io/downloads/releases/crash_standalone_latest

Then, make it executable:

$ chmod +x crash

Now, run it:

$ ./crash

If you would like to run crash from any directory and without using leading ./ you will need to move it to somewhere on your $PATH.

Usage

For usage information and options, run:

$ crash --help

Contributing

This project is primarily maintained by Crate.io, but we welcome community contributions!

See the developer docs and the contribution docs for more information.

Help

Looking for more help?

Installation & Usage

If the package was installed using pip the shell can be started by invoking crash in a terminal. We recommend to install it to the Python user install directory to avoid unwanted dependency conflicts.

pip install --user crash

Note

If crash is installed in the Python user install directory please ensure that ~/.local/bin (Linux), or %APPDATA%\Python\<version>\Scripts (Windows) is added to the system path.

crash by default will try to connect to localhost:4200. To connect to another host use the connect command inside the shell or use the --hosts argument when launching the shell.

crash started with the -v switch (once or more times) will log useful information when it comes to debugging, like what connection attempts are made and full tracebacks of server errors.

For more information about the available command line arguments see Command Line Arguments.

When you connect to a server that is not reachable or whose hostname cannot be resolved you will get an error:

cr> \connect 127.0.0.1:65535
+------------------------+-----------+---------+-----------+-----------...-+
| server_url             | node_name | version | connected | message       |
+------------------------+-----------+---------+-----------+-----------...-+
| http://127.0.0.1:65535 |      NULL | 0.0.0   | FALSE     | Server not... |
+------------------------+-----------+---------+-----------+-----------...-+
CONNECT ERROR
cr> \connect 300.300.300.300:4200
+-----------------------------+-----------+---------+-----------+-------------...-+
| server_url                  | node_name | version | connected | message         |
+-----------------------------+-----------+---------+-----------+-------------...-+
| http://300.300.300.300:4200 |      NULL | 0.0.0   | FALSE     | Server not a... |
+-----------------------------+-----------+---------+-----------+-------------...-+
CONNECT ERROR

Successful connects will give you some information about the servers you connect to:

cr> \connect 127.0.0.1:44209;
+------------------------+-----------+---------+-----------+---------+
| server_url             | node_name | version | connected | message |
+------------------------+-----------+---------+-----------+---------+
| http://127.0.0.1:44209 | crate     | ...     | TRUE      | OK      |
+------------------------+-----------+---------+-----------+---------+
CONNECT OK...

If you connect to more than one server, the command will succeed if at least one server is reachable:

cr> \connect 127.0.0.1:44209 300.300.300.300:4295;
+-----------------------------+-----------+---------+-----------+-----------...-+
| server_url                  | node_name | version | connected | message       |
+-----------------------------+-----------+---------+-----------+-----------...-+
| http://127.0.0.1:44209      | crate     | ...     | TRUE      | OK            |
| http://300.300.300.300:4295 | NULL      | 0.0.0   | FALSE     | Server not... |
+-----------------------------+-----------+---------+-----------+-----------...-+
CONNECT OK...

Once the shell is connected, SQL statements can be executed simply by entering them without any special arguments like this:

cr> SELECT table_name FROM information_schema.tables
... WHERE table_name = 'cluster';
+------------+
| table_name |
+------------+
| cluster    |
+------------+
SELECT 1 row in set (... sec)

When the CrateDB shell is started with the option -v debugging information will be printed:

cr> select x from y;
SQLActionException[TableUnknownException: Table 'doc.y' unknown]
SQLActionException: NOT_FOUND 4041 TableUnknownException: Table 'doc.y' unknown
...

Limitations

Note

Due to changes in the Information Schema of CrateDB, Crash versions <= 0.19 are not compatible with CrateDB > 0.57.

Nested Objects and Arrays

Note

Since CrateDB 0.39.0 it is possible to use object and array literals and the limitation does not apply when connecting to a CrateDB instance running > 0.39.0.

While it is possible to select or filter by nested objects it is currently not possible to insert them using Crash. In order to do that the CrateDB REST endpoint or a client library like crate-python has to be used.

The same also applies for arrays.

Release History

Release History

This version
History Node

0.22.3

History Node

0.22.2

History Node

0.22.1

History Node

0.22.0

History Node

0.21.5

History Node

0.21.4

History Node

0.21.3

History Node

0.21.2

History Node

0.21.1

History Node

0.21.0

History Node

0.20.1

History Node

0.20.0

History Node

0.19.1

History Node

0.19.0

History Node

0.18.1

History Node

0.18.0

History Node

0.17.2

History Node

0.17.1

History Node

0.17.0

History Node

0.16.1

History Node

0.16.0

History Node

0.15.0

History Node

0.14.3

History Node

0.14.2

History Node

0.14.1

History Node

0.14.0

History Node

0.13.1

History Node

0.13.0

History Node

0.12.1

History Node

0.12.0

History Node

0.11.5

History Node

0.11.4

History Node

0.11.3

History Node

0.11.2

History Node

0.11.1

History Node

0.11.0

History Node

0.10.3

History Node

0.10.2

History Node

0.10.1

History Node

0.10.0

History Node

0.9.14

History Node

0.9.13

History Node

0.9.12

History Node

0.9.11

History Node

0.9.10

History Node

0.9.9

History Node

0.9.8

History Node

0.9.7

History Node

0.9.6

History Node

0.9.5

History Node

0.9.4

History Node

0.9.3

History Node

0.9.2

History Node

0.9.1

History Node

0.9.0

History Node

0.8.3

History Node

0.8.2

History Node

0.8.0

History Node

0.7.1

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
crash-0.22.3-py2.py3-none-any.whl (63.2 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Nov 13, 2017
crash-0.22.3.tar.gz (53.3 kB) Copy SHA256 Checksum SHA256 Source Nov 13, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting