dql package¶
Subpackages¶
Submodules¶
Module contents¶
Simple SQL-like query language for dynamo.
-
class
dql.
Engine
(connection=None)[source]¶ Bases:
object
DQL execution engine
Parameters: - connection :
DynamoDBConnection
, optional If not present, you will need to call
Engine.connect()
Attributes: - caution_callback : callable, optional
Called to prompt user when a potentially dangerous action is about to occur.
-
describe
(tablename: str, refresh: bool = False, metrics: bool = False, require: bool = False) → Optional[dql.models.TableMeta][source]¶ Get the
TableMeta
for a table
-
execute
(commands, pretty_format=False)[source]¶ Parse and run a DQL string
Parameters: - commands : str
The DQL command string
- pretty_format : bool
Pretty-format the return value. (e.g. 4 -> ‘Updated 4 items’)
- connection :
-
class
dql.
FragmentEngine
(connection=None)[source]¶ Bases:
dql.engine.Engine
A DQL execution engine that can handle query fragments
-
class
dql.
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
-
do_local
(host='localhost', port=8000)[source]¶ Connect to a local DynamoDB instance. Use ‘local off’ to disable.
> local > local host=localhost port=8001 > local off
-
do_throttle
(*_args)[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
(*args)[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
-
emptyline
()[source]¶ Called when an empty line is entered in response to the prompt.
If this method is not overridden, it repeats the last nonempty command entered.
-
initialize
(region: str = 'us-west-1', host: str = None, port: int = 8000, config_dir: Optional[str] = None, session: Optional[Any] = None) → None[source]¶ Set up the repl for execution.