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)
caution_callback(action)[source]

Prompt user for manual continue when doing write operation on all items in a table

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_opt_pagesize(*_)[source]

Autocomplete for pagesize option

complete_opt_width(*_)[source]

Autocomplete for width option

complete_use(text, *_)[source]

Autocomplete for use

complete_watch(text, *_)[source]

Autocomplete for watch

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

Autocomplete table names in queries

conf = None[source]
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_throttle(arglist)[source]

Set the allowed consumed throughput for DQL.

# Set the total allowed throughput across all tables > throttle 1000 100 # Set the default allowed throughput per-table/index > throttle default 40% 20% # Set the allowed throughput on a table > throttle mytable 10 10 # Set the allowed throughput on a global index > throttle mytable myindex 40 6

see also: unthrottle

do_unthrottle(arglist)[source]

Remove the throughput limits for DQL that were set with ‘throttle’

# Remove all limits > unthrottle # Remove the limit on total allowed throughput > unthrottle total # Remove the default limit > unthrottle default # Remove the limit on a table > unthrottle mytable # Remove the limit on a global index > unthrottle mytable myindex

do_use(arglist)[source]

Switch the AWS region

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

do_watch(arglist)[source]

Watch Dynamo tables consumed capacity

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_analyze()[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_explain()[source]

Print the help text for EXPLAIN

help_help()[source]

Print the help text for help

help_insert()[source]

Print the help text for INSERT

help_load()[source]

Print the help text for LOAD

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 width of output (‘auto’ will auto-detect terminal width)

postcmd(stop, line)[source]
run_command(command)[source]

Run a command passed in from the command line with -c

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.indent(string, prefix=' ')[source]

Indent a paragraph of text

dql.cli.prompt(msg, default=<object object>, validate=None)[source]

Prompt user for input

dql.cli.promptyn(msg, default=None)[source]

Display a blocking prompt until the user confirms

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.