Home

Awesome

QLDB Interactive Shell

License CI Build

This tool provides an interface to send PartiQL statements to Amazon Quantum Ledger Database (QLDB). This tool is not intended to be incorporated into an application or adopted for production purposes. The objective of the tool is to give developers, devops, database administrators, and anyone else interested the opportunity for rapid experimentation with QLDB and PartiQL.

Prerequisites

This readme assumes you have an AWS account, an environment configured with AWS credentials, as well as IAM users/roles with appropriate access to QLDB. This readme focuses on shell configuration and commands. For a guide about prerequisites and general use of the shell, please see the Developer Guide: Using the Amazon QLDB Shell

QLDB Core Concepts

Installation

In general, see releases for the latest and greatest. We provide prebuilt binaries for Linux, Windows and macOS. Find your platform, download, extract and run!

If your platform is not supported, feel free to open an issue!

macOS

On macOS, we integrate with the aws/tap Homebrew tap:

xcode-select --install # required to use Homebrew
brew tap aws/tap # Add AWS as a Homebrew tap
brew install qldbshell
qldb --ledger <your-ledger>

Configuration

After installation, the Shell will load default config file located at $XDG_CONFIG_HOME/qldbshell/config.ion during initialization. On Linux and Macos, this will typically be at ~/.config/qldbshell/config.ion. If such a file doesn't exist, the shell will run with default settings.

You can create a config.ion config file manually after installation. The config file uses Ion. If you're new to Ion, you can consider the file to be JSON with support for comments and you'll be just fine!

{
  default_ledger: "my-ledger",

  ui: {
    // Determines whether each statement will be executed as a transaction or not.
    // By default this is on, meaning that statements are all executed as individual transactions.
    auto_commit: true, // the default; can be set to false

    // Set your prompt to your desired value. The following values can be interpolated:
    //   - $REGION: the name of the AWS region
    //   - $LEDGER: the name of the ledger
    //   - $ACTIVE_TRANSACTION: the string " \*" if a transaction is open
    prompt: "your-prompt-syntax", // default: "qldb$ACTIVE_TRANSACTION> "

    // format = [ion|table]
    //   ion: Prints the objects from the database as ION documents in text.
    //   table: Tabulates the data and prints out the data as rows.
    format: "table", // or ion default: ion

    edit_mode: "Emacs", // or Vi default: Emacs

    // Can be toggled to suppress some messaging when runnning in interactive mode
    display_welcome: true, // the default; can be set to false
    display_ctrl_signals: true,

    // Determines whether or not metrics will be emitted after the results of a query are shown.
    display_query_metrics: true,

    // Set terminator_required to true indicates that pressing the enter key at the end of a line of input will not execute the command by itself.
    // Alternately, if you end your statement with a semi-colon (`;`) you will execute the statement.
    terminator_required: true
  }
}

An example minimal config.ion config file:

{
  default_ledger: "my-ledger"
}

If default_ledger is not set, then --ledger becomes a required CLI parameter.

Building from source

See HACKING.md for further instructions

Command interface

Shell Keys

Database commands

Shell Meta Commands

All commands to the shell itself will be prefixed with a backslash \, e.g:

License

This project is licensed under the Apache-2.0 License.