| --- |
| layout: docpage |
| |
| title: "Documentation" |
| |
| is_homepage: false |
| is_sphinx_doc: true |
| |
| doc-parent: "Getting Started" |
| |
| doc-title: "Inserting and querying" |
| doc-header-links: ' |
| <link rel="top" title="Apache Cassandra Documentation v3.10" href="../index.html"/> |
| <link rel="up" title="Getting Started" href="index.html"/> |
| <link rel="next" title="Client drivers" href="drivers.html"/> |
| <link rel="prev" title="Configuring Cassandra" href="configuring.html"/> |
| ' |
| doc-search-path: "../search.html" |
| |
| extra-footer: ' |
| <script type="text/javascript"> |
| var DOCUMENTATION_OPTIONS = { |
| URL_ROOT: "", |
| VERSION: "", |
| COLLAPSE_INDEX: false, |
| FILE_SUFFIX: ".html", |
| HAS_SOURCE: false, |
| SOURCELINK_SUFFIX: "" |
| }; |
| </script> |
| ' |
| |
| --- |
| <div class="container-fluid"> |
| <div class="row"> |
| <div class="col-md-2"> |
| <div class="doc-navigation"> |
| <div class="doc-menu" role="navigation"> |
| <div class="navbar-header"> |
| <button type="button" class="pull-left navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| </div> |
| <div class="navbar-collapse collapse sidebar-navbar-collapse"> |
| <form id="doc-search-form" class="navbar-form" action="../search.html" method="get" role="search"> |
| <div class="form-group"> |
| <input type="text" size="30" class="form-control input-sm" name="q" placeholder="Search docs"> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </div> |
| </form> |
| |
| |
| |
| <ul class="current"> |
| <li class="toctree-l1 current"><a class="reference internal" href="index.html">Getting Started</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="installing.html">Installing Cassandra</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="configuring.html">Configuring Cassandra</a></li> |
| <li class="toctree-l2 current"><a class="current reference internal" href="#">Inserting and querying</a><ul> |
| <li class="toctree-l3"><a class="reference internal" href="#cqlsh">CQLSH</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="#client-drivers">Client drivers</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="drivers.html">Client drivers</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="../architecture/index.html">Architecture</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../data_modeling/index.html">Data Modeling</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../cql/index.html">The Cassandra Query Language (CQL)</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../configuration/index.html">Configuring Cassandra</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../operating/index.html">Operating Cassandra</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../tools/index.html">Cassandra Tools</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../troubleshooting/index.html">Troubleshooting</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../development/index.html">Cassandra Development</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../faq/index.html">Frequently Asked Questions</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../bugs.html">Reporting Bugs and Contributing</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../contactus.html">Contact us</a></li> |
| </ul> |
| |
| |
| |
| </div><!--/.nav-collapse --> |
| </div> |
| </div> |
| </div> |
| <div class="col-md-8"> |
| <div class="content doc-content"> |
| <div class="container"> |
| |
| <div class="section" id="inserting-and-querying"> |
| <h1>Inserting and querying<a class="headerlink" href="#inserting-and-querying" title="Permalink to this headline">¶</a></h1> |
| <p>The API to Cassandra is <a class="reference internal" href="../cql/index.html#cql"><span class="std std-ref">CQL</span></a>, the Cassandra Query Language. To use CQL, you will need to connect to the |
| cluster, which can be done:</p> |
| <ul class="simple"> |
| <li>either using cqlsh,</li> |
| <li>or through a client driver for Cassandra.</li> |
| </ul> |
| <div class="section" id="cqlsh"> |
| <h2>CQLSH<a class="headerlink" href="#cqlsh" title="Permalink to this headline">¶</a></h2> |
| <p>cqlsh is a command line shell for interacting with Cassandra through CQL. It is shipped with every Cassandra package, |
| and can be found in the bin/ directory alongside the cassandra executable. It connects to the single node specified on |
| the command line. For example:</p> |
| <div class="highlight-default"><div class="highlight"><pre><span></span>$ bin/cqlsh localhost |
| Connected to Test Cluster at localhost:9042. |
| [cqlsh 5.0.1 | Cassandra 3.8 | CQL spec 3.4.2 | Native protocol v4] |
| Use HELP for help. |
| cqlsh> SELECT cluster_name, listen_address FROM system.local; |
| |
| cluster_name | listen_address |
| --------------+---------------- |
| Test Cluster | 127.0.0.1 |
| |
| (1 rows) |
| cqlsh> |
| </pre></div> |
| </div> |
| <p>See the <a class="reference internal" href="../tools/cqlsh.html#cqlsh"><span class="std std-ref">cqlsh section</span></a> for full documentation.</p> |
| </div> |
| <div class="section" id="client-drivers"> |
| <h2>Client drivers<a class="headerlink" href="#client-drivers" title="Permalink to this headline">¶</a></h2> |
| <p>A lot of client drivers are provided by the Community and a list of known drivers is provided in <a class="reference internal" href="drivers.html#client-drivers"><span class="std std-ref">the next section</span></a>. You should refer to the documentation of each drivers for more information on how to use them.</p> |
| </div> |
| </div> |
| |
| |
| |
| |
| <div class="doc-prev-next-links" role="navigation" aria-label="footer navigation"> |
| |
| <a href="drivers.html" class="btn btn-default pull-right " role="button" title="Client drivers" accesskey="n">Next <span class="glyphicon glyphicon-circle-arrow-right" aria-hidden="true"></span></a> |
| |
| |
| <a href="configuring.html" class="btn btn-default" role="button" title="Configuring Cassandra" accesskey="p"><span class="glyphicon glyphicon-circle-arrow-left" aria-hidden="true"></span> Previous</a> |
| |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| <div class="col-md-2"> |
| </div> |
| </div> |
| </div> |