Connect to the CQL shell for Astra DB
To run CQL statements against your Astra DB Serverless databases, you can use the CQL shell (cqlsh), a Cassandra driver, or the Data API.
This guide explains how to use the CQL shell (cqlsh) to interact with your Astra DB databases.
For information about other connection methods, see Cassandra Query Language (CQL) for Astra DB.
The CQL shell (cqlsh) is a utility that you can use to issue CQL and cqlsh commands to your Astra DB Serverless databases.
You can use the CQL console in the Astra Portal, or you can install the CQL shell utility with the Astra CLI.
Use the CQL console (embedded CQL shell)
In the Astra Portal, each Astra DB Serverless database has access to the CQL console, which is an embedded CQL shell instance.
You can use the CQL console to run CQL and cqlsh commands on your databases directly from your browser without installing any additional software.
-
In the Astra Portal, click the name of the database that you want to connect to.
-
Click CQL console to open the embedded CQL shell in a new tab.
-
Wait for the
token@cqlsh>prompt to appear.This prompt indicates that CQL shell is connected to your database, and you can start sending CQL and
cqlshcommands to your database. -
Optional: For multi-region databases, use the region menu to access data from a secondary region. Typically, you change regions only if the primary region is geographically distant from your machine. Due to Astra DB’s eventual consistency model, changes to data in any region are eventually replicated to the database’s other regions.
|
To directly access the built-in CQL console app for your database, sign in to the Astra Portal, and then navigate to the following URL:
Replace the following:
If you use custom domains, replace |
Use the standalone CQL shell
For remote programmatic access, use the Astra CLI to download, install, and use the standalone CQL shell utility: