Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

DynamoDB Query Language

Project description


Build:build coverage

A simple, SQL-ish language for DynamoDB

Getting Started

The easiest way to use DQL is to download and run the install script:

curl -o

This will create a standalone dql file that you can run. If you would instead like to install it with pip:

pip install dql

Here are some basic DQL examples to get you going:

Start the REPL:

$ dql

Creating a table:

us-west-1> CREATE TABLE forum_threads (name STRING HASH KEY,
         >                             subject STRING RANGE KEY,
         >                             THROUGHPUT (4, 2));

Inserting data:

us-west-1> INSERT INTO forum_threads (name, subject, views, replies)
         > VALUES ('Self Defense', 'Defense from Banana', 67, 4),
         > ('Self Defense', 'Defense from Strawberry', 10, 0),
         > ('Cheese Shop', 'Anyone seen the camembert?', 16, 1);


us-west-1> SCAN * FROM forum_threads;
us-west-1> SELECT count(*) FROM forum_threads WHERE name = 'Self Defense';
us-west-1> SELECT * FROM forum_threads WHERE name = 'Self Defense';


us-west-1> UPDATE forum_threads ADD views 1 WHERE
         > name = 'Self Defense' AND subject = 'Defense from Banana';
us-west-1> DELETE FROM forum_threads WHERE name = 'Cheese Shop';

Changing tables:

us-west-1> ALTER TABLE forum_threads SET THROUGHPUT (8, 4);
us-west-1> DROP TABLE forum_threads;

And don’t forget to use help!



  • Use python-future instead of six as compatibility library
  • Now distributing a wheel package
  • Bug fix: Confirmation prompts crash on Python 2


  • Bug fix: Compatibility errors with Python 3


  • Bug fix: Support key conditions where field has a - in the name


  • Bug fix: Default encoding error on mac

Dropping support for python 2.6


  • Bug fix: Can now run any CLI command using -c "command"


  • Bug fix: Crash fix when resizing terminal with ‘watch’ command active
  • ‘Watch’ columns will dynamically resize to fit terminal width


  • Bug fix: When saving to JSON floats are no longer cast to ints
  • Bug fix: Reserved words are correctly substituted when using WHERE … IN


  • Locked in the version of pyparsing after 2.1.5 broke compatibility again.


  • Bug fix: Correct name substitution/selection logic
  • Swapped out bin/ for bin/ Similar concept, better execution.


  • Bug fix: Can’t display Binary data


  • Bug fix: Can’t use boolean values in update statements


  • Gracefully handle missing imports on Windows


  • Missing curses library won’t cause ImportError


  • Fix bug where query would sometimes display ‘No Results’ even when results were found.


  • Differentiate LIMIT and SCAN LIMIT
  • Options and query syntax for throttling the consumed throughput
  • Crash fixes and other small robustness improvements


  • SELECT <attributes> can now use full expressions


  • LOAD command to insert records from a file created with SELECT ... SAVE
  • Default SAVE format is pickle
  • SAVE command can gzip the file


  • Don’t print results to console when saving to a file
  • ‘auto’ pagesize to adapt to terminal height
  • When selecting specific attributes with KEYS IN only those attributes are fetched
  • ORDER BY queries spanning multiple pages no longer stuck on first page
  • Column formatter fits column widths more intelligently
  • Smart formatter is smarter about switching to Expanded mode


  • Tab completion for Mac OS X


  • locks in a version
  • Display output auto-detects terminal width


  • Format option saves properly
  • WHERE expressions can compare fields to fields (e.g. WHERE foo > bar)
  • Always perform batch_get after querying/scanning an index that doesn’t project all attributes


  • General bug fixes
  • Self contained script


  • Fixes for watch display
  • SELECT can save the results to a file


  • ALTER commands can specify IF (NOT) EXISTS
  • New watch command to monitor table consumed capacities
  • SELECT can fetch attributes that aren’t projected onto the queried index
  • SELECT can ORDER BY non-range-key attributes


  • EXPLAIN <query> will print out the DynamoDB calls that will be made when you run the query
  • ANALYZE <query> will run the query and print out consumed capacity information


  • Pretty-format non-item query return values (such as count)
  • Disable passing AWS credentials on the command line


  • Breakage: New syntax for SELECT, SCAN, UPDATE, DELETE
  • Breakage: Removed COUNT query (now SELECT count(*))
  • Breakage: Removed the ability to embed python in queries
  • New alternative syntax for INSERT
  • ALTER can create and drop global indexes
  • Queries and updates now use the most recent DynamoDB expressions API
  • Unified options in CLI under the opt command


  • Update to maintain compatibility with new versions of botocore and dynamo3
  • Improving CloudWatch support (which is used to get consumed table capacity)


  • Breakage: Dropping support for python 3.2 due to lack of botocore support
  • Feature: Support for JSON data types


  • Bug fix: Allow ‘.’ in table names of DUMP SCHEMA command
  • Bug fix: Passing a port argument to local connection doesn’t crash
  • Bug fix: Prompt says ‘localhost’ when connected to DynamoDB local


  • Bug fix: Allow ‘.’ in table names


  • Feature: SELECT and COUNT can have FILTER clause
  • Feature: FILTER clause may OR constraints together


  • Bug fix: Crash when printing ‘COUNT’ queries


  • Feature: Python 3 support


  • First public release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
dql-0.5.26-py2.py3-none-any.whl (53.6 kB) Copy SHA256 hash SHA256 Wheel py2.py3
dql-0.5.26.tar.gz (45.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page