dql.cli module

Interative DQL client

class dql.cli.DQLClient(completekey='tab', stdin=None, stdout=None)[source]

Bases: cmd.Cmd

Interactive commandline interface.

Attributes

running (bool) True while session is active, False after quitting
engine (dql.engine.FragmentEngine)
complete_file(text, line, *_)[source]

Autocomplete DQL file lookup

complete_ls(text, *_)[source]

Autocomplete for ls

complete_opt(text, line, begidx, endidx)[source]

Autocomplete for options

complete_opt_allow_select_scan(text, *_)[source]

Autocomplete for allow_select_scan option

complete_opt_display(text, *_)[source]

Autocomplete for display option

complete_opt_format(text, *_)[source]

Autocomplete for format option

complete_use(text, *_)[source]

Autocomplete for use

completedefault(text, line, *_)[source]

Autocomplete table names in queries

default(command)[source]
display = None[source]
do_EOF(arglist)[source]

Exit

do_exit(arglist)[source]

Exit

do_file(arglist)[source]

Read and execute a .dql file

do_local(arglist)[source]

Connect to a local DynamoDB instance. Use ‘local off’ to disable.

> local > local host=localhost port=8001 > local off

do_ls(arglist)[source]

List all tables or print details of one table

do_opt(arglist)[source]

Get and set options

do_shell(arglist)[source]

Run a shell command

do_use(arglist)[source]

Switch the AWS region

> use us-west-1 > use us-east-1

emptyline()[source]
engine = None[source]
formatter = None[source]
getopt_default(option)[source]

Default method to get an option

getopt_display()[source]

Get value for display option

getopt_format()[source]

Get value for format option

help_alter()[source]

Print the help text for ALTER

help_create()[source]

Print the help text for CREATE

help_delete()[source]

Print the help text for DELETE

help_drop()[source]

Print the help text for DROP

help_dump()[source]

Print the help text for DUMP

help_help()[source]

Print the help text for help

help_insert()[source]

Print the help text for INSERT

help_opt()[source]

Print the help text for options

help_scan()[source]

Print the help text for SCAN

help_select()[source]

Print the help text for SELECT

help_update()[source]

Print the help text for UPDATE

initialize(region='us-west-1', host=None, port=8000, config_dir=None, session=None)[source]

Set up the repl for execution.

load_config()[source]

Load your configuration settings from a file

opt_allow_select_scan(allow)[source]

Set option allow_select_scan

opt_display(display)[source]

Set value for display option

opt_format(format)[source]

Set value for format option

opt_pagesize(pagesize)[source]

Get or set the page size of the query output

opt_width(width)[source]

Set value for width option

postcmd(stop, line)[source]
running = False[source]
save_config()[source]

Save the conf file

session = None[source]
start()[source]

Start running the interactive session (blocking)

update_prompt()[source]

Update the prompt

dql.cli.get_enum_key(key, choices)[source]

Get an enum by prefix or equality

dql.cli.repl_command(fxn)[source]

Decorator for cmd methods

Parses arguments from the arg string and passes them to the method as *args and **kwargs.