kdcro101 / vscode-cassandra

Design and query Apache Cassandra database with help of generated templates, autocomplete and inline code decorations in Visual Studio Code
GNU General Public License v3.0
22 stars 6 forks source link
apache-cassandra cql database nosql workbench

Cassandra workbench for Visual Studio Code

Visual Studio Marketplace Installs Rating Build Status

Design and query Apache Cassandra database with help of generated templates, autocomplete and inline code decorations. Supports Apache Cassandra versions 2.* and 3.*

Quick start

Open workspace (workspace path is needed for configuration to generate), activate extension by running command from palette Cassandra Workbench: Generate configuration. This will generate .cassandraWorkbench.jsonc configuration file.

Switch to Cassandra worbench panel by clicking activity bar icon. Edit .cassandraWorkbench.jsonc to suit your needs. (configuration)

Editor UI

Limitations

Multiple SELECT statements per script are not allowed. You will be notified by message:

Unable to execute multiple SELECT statements

Mixing SELECT statements with data/structure altering statements is not allowed. You will be notified by message:

Unable to execute SELECT statement along with data or structure altering statements

Key bindings

Binding
CTRL+ALT+F Find in script
CTRL+ALT+H Replace in script
CTRL+A Select all
CTRL+ENTER Execute script

Configuration

.cassandraWorkbench.jsonc file contains array of cluster connection items.

Authentication modes, currently supported (more info):

When using PasswordAuthenticator, user, used to connect, must have SELECT permissions to access:

Default configuration (generated by Cassandra Workbench: Generate configuration):

// name must be unique!
[
    // AllowAllAuthenticator
    {
        "name": "Cluster AllowAllAuthenticator",
        "contactPoints": ["127.0.0.1"]
    },
    //PasswordAuthenticator
    {
        "name": "Cluster PasswordAuthenticator",
        "contactPoints": ["127.0.0.1"],
        "authProvider": {
            "class": "PasswordAuthenticator",
            "username": "yourUsername",
            "password": "yourPassword"
        }
    }
]

Add/remove and reconfigure cluster items as needed.

Workspace configuration

cassandraWorkbench.excludeKeyspaces: string[] - default []

To exclude system keyspaces use:

    "cassandraWorkbench.excludeKeyspaces": [
            "^system$",
            "^system_auth$",
            "^system_distributed$",
            "^system_traces$",
            "^system_schema$"
        ]

cassandraWorkbench.useWorkspace : number - default 0