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

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

complete_file(self, text, line, *_)[source]

Autocomplete DQL file lookup

complete_ls(self, text, *_)[source]

Autocomplete for ls

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

Autocomplete for options

complete_opt_allow_select_scan(self, text, *_)[source]

Autocomplete for allow_select_scan option

complete_opt_display(self, text, *_)[source]

Autocomplete for display option

complete_opt_format(self, text, *_)[source]

Autocomplete for format option

complete_opt_pagesize(self, *_)[source]

Autocomplete for pagesize option

complete_opt_width(self, *_)[source]

Autocomplete for width option

complete_use(self, text, *_)[source]

Autocomplete for use

complete_watch(self, text, *_)[source]

Autocomplete for watch

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

Autocomplete table names in queries

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

Exit

do_exit(self, arglist)[source]

Exit

do_file(self, arglist)[source]

Read and execute a .dql file

do_local(self, arglist)[source]

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

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

do_ls(self, arglist)[source]

List all tables or print details of one table

do_opt(self, arglist)[source]

Get and set options

do_shell(self, arglist)[source]

Run a shell command

do_throttle(self, 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(self, 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(self, arglist)[source]

Switch the AWS region

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

do_watch(self, arglist)[source]

Watch Dynamo tables consumed capacity

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

Default method to get an option

getopt_display(self)[source]

Get value for display option

getopt_format(self)[source]

Get value for format option

help_alter(self)[source]

Print the help text for ALTER

help_analyze(self)[source]

Print the help text for ALTER

help_create(self)[source]

Print the help text for CREATE

help_delete(self)[source]

Print the help text for DELETE

help_drop(self)[source]

Print the help text for DROP

help_dump(self)[source]

Print the help text for DUMP

help_explain(self)[source]

Print the help text for EXPLAIN

help_help(self)[source]

Print the help text for help

help_insert(self)[source]

Print the help text for INSERT

help_load(self)[source]

Print the help text for LOAD

help_opt(self)[source]

Print the help text for options

help_scan(self)[source]

Print the help text for SCAN

help_select(self)[source]

Print the help text for SELECT

help_update(self)[source]

Print the help text for UPDATE

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

Set up the repl for execution.

load_config(self)[source]

Load your configuration settings from a file

opt_allow_select_scan(self, allow)[source]

Set option allow_select_scan

opt_display(self, display)[source]

Set value for display option

opt_format(self, fmt)[source]

Set value for format option

opt_pagesize(self, pagesize)[source]

Get or set the page size of the query output

opt_width(self, width)[source]

Set width of output (‘auto’ will auto-detect terminal width)

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

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

running = False[source]
save_config(self)[source]

Save the conf file

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

Start running the interactive session (blocking)

throttle = None[source]
update_prompt(self)[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 at 0x7ff2423a0090>, 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.