Skip to content

Commit

Permalink
strip down usage.txt and move to connect.txt as test doc only
Browse files Browse the repository at this point in the history
  • Loading branch information
Naomi Slater committed Apr 20, 2018
1 parent ed0a79a commit a6abd82
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 64 deletions.
1 change: 0 additions & 1 deletion docs/usage.txt

This file was deleted.

3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -41,8 +41,7 @@ def read(path):


long_description = (
read('README.rst') + '\n' +
read(os.path.join('src', 'crate', 'crash', 'usage.txt'))
read('README.rst')
)

versionf_content = read(os.path.join('src', 'crate', 'crash', '__init__.py'))
Expand Down
71 changes: 11 additions & 60 deletions src/crate/crash/usage.txt → src/crate/crash/connect.txt
@@ -1,33 +1,9 @@
====================
Installation & Usage
====================
=================
+Connection Tests
=================

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::
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
+------------------------+-----------+---------+-----------+-----------...-+
Expand All @@ -47,7 +23,8 @@ you will get an error::
+-----------------------------+-----------+---------+-----------+-------------...-+
CONNECT ERROR

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

cr> \connect 127.0.0.1:44209;
+------------------------+-----------+---------+-----------+---------+
Expand All @@ -57,8 +34,8 @@ Successful connects will give you some information about the servers you connect
+------------------------+-----------+---------+-----------+---------+
CONNECT OK...

If you connect to more than one server, the command will succeed
if at least one server is reachable::
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;
+-----------------------------+-----------+---------+-----------+-----------...-+
Expand All @@ -81,36 +58,10 @@ them without any special arguments like this::
+------------+
SELECT 1 row in set (... sec)

When the CrateDB shell is started with the option ``-v`` debugging information will be printed::
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.

.. _`CrateDB REST Endpoint`: https://crate.io/docs/current/sql/rest.html
.. _`Command Line Arguments`: https://crate.io/docs/projects/crash/en/stable/cli.html
.. _`crate-python`: https://pypi.python.org/pypi/crate/
2 changes: 1 addition & 1 deletion src/crate/crash/tests.py
Expand Up @@ -96,7 +96,7 @@ def test_suite():
suite = unittest.TestSuite()
flags = (doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS)
s = doctest.DocFileSuite(
'usage.txt', 'output.txt',
'connect.txt', 'output.txt',
setUp=setUp,
tearDown=tearDown,
optionflags=flags,
Expand Down

0 comments on commit a6abd82

Please sign in to comment.