dql.engine module

Execution engine

class dql.engine.Engine(connection=None)[source]

Bases: object

DQL execution engine

Parameters:

connection : DynamoDBConnection, optional

If not present, you will need to call Engine.connect_to_region()

Notes

One of the advanced features of the engine is the ability to set variables which can later be referenced in queries. Whenever a STRING or NUMBER is expected in a query, you may alternatively supply a variable name. That name will be looked up in the engine’s scope. This allows you to do things like:

engine.scope['myfoo'] = 'abc'
engine.execute("SELECT * FROM foobars WHERE foo = myfoo")

Attributes

scope dict Lookup scope for variables
cloudwatch_connection[source]

Lazy create a connection to cloudwatch

connect_to_region(region, **kwargs)[source]

Connect the engine to an AWS region

connection[source]

Get the dynamo connection

describe(tablename, refresh=False, metrics=False)[source]

Get the TableMeta for a table

describe_all()[source]

Describe all tables in the connected region

execute(commands)[source]

Parse and run a DQL string

Parameters:

commands : str

The DQL command string

get_capacity(tablename)[source]

Get the consumed read/write capacity

resolve(val, scope=None)[source]

Resolve a value into a string or number

class dql.engine.FragmentEngine(connection)[source]

Bases: dql.engine.Engine

A DQL execution engine that can handle query fragments

execute(fragment)[source]

Run or aggregate a query fragment

Concat the fragment to any stored fragments. If they form a complete query, run it and return the result. If not, store them and return None.

partial[source]

True if there is a partial query stored

pformat_exc(exc)[source]

Format an exception message for the last query’s parse error

reset()[source]

Clear any query fragments from the engine

dql.engine.float_to_decimal(f)[source]

Monkey-patched replacement for boto’s broken version

Read the Docs v: 0.1.0
Versions
latest
0.1.0
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.