Skip to main content

DynamoDB Query Language

Project description

DQL

Build:

build coverage

Documentation:

http://dql.readthedocs.org/

Downloads:

http://pypi.python.org/pypi/dql

Source:

https://github.com/mathcamp/dql

A simple, SQL-ish language for DynamoDB

Getting Started

Install with pip:

pip install dql

Here are some basic DQL examples to get you going:

Start the REPL:

$ dql
us-west-1>

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);

Queries:

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';

Mutations:

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!

Changelog

0.5.0

  • 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

0.4.1

  • Update to maintain compatibility with new versions of botocore and dynamo3

  • Improving CloudWatch support (which is used to get consumed table capacity)

0.4.0

  • Breakage: Dropping support for python 3.2 due to lack of botocore support

  • Feature: Support for JSON data types

0.3.2

  • 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

0.3.1

  • Bug fix: Allow ‘.’ in table names

0.3.0

  • Feature: SELECT and COUNT can have FILTER clause

  • Feature: FILTER clause may OR constraints together

0.2.1

  • Bug fix: Crash when printing ‘COUNT’ queries

0.2.0

  • Feature: Python 3 support

0.1.0

  • 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.

Source Distribution

dql-0.5.0.tar.gz (31.4 kB view details)

Uploaded Source

File details

Details for the file dql-0.5.0.tar.gz.

File metadata

  • Download URL: dql-0.5.0.tar.gz
  • Upload date:
  • Size: 31.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dql-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a68fd904a39b525b16930491e802668be6e8406b3160f9ecd858aa8423f70f8a
MD5 ce439850b06485dc37274ddbc1f3f06d
BLAKE2b-256 d5c760ed58989199487c1efd9b0d27e5704eda71c89e0a677d69df0b18a8e129

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page