Skip to content

alexanderlz/dql

 
 

Repository files navigation

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!

About

A SQL-ish language for DynamoDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.5%
  • Shell 0.5%