Dynamo query REPL
brew tap joprice/tap && brew install dynamite
A limited subset of dynamo and sql are currently supported:
dql> select * from playlists limit 10;
When using a where clause, the table or an appropriate index will be used:
dql> select * from playlists where userId = 1 and id = 2 limit 10;
If there are redundant indexes or for some reason an appropriate one cannnot be found, use use index
to provide it explicitly:
dql> select * from playlists where userId = 1 limit 10 use index profileIdIndex;
dql> select id, name from playlists limit 1;
dql> insert into playlists (userId, id) values (1, 10);
dql> update playlists set name = '80s Party' where userId = 1 and id = 10;
dql> delete from playlists where userId = 1 and id = 10;
dql> show tables;
dql> describe table playlists;
By default, Dynamite connects to the DynamoDB instance found via the AWS SDK. To connect to a one-off instance of DynamoDB Local, pass the --load
flag:
dynamite --local
Dynamite can also be used to run a single script:
dynamite < query.dql
By default, the output is the same as the repl output. This can also be set to 'json' or 'json-pretty':
dynamite --format=json < query.dql
dynamite --format=json-pretty < query.dql
- load dynamo client in background on startup
- order keys before other fields when
select *
- check value type matches when building query key conditions
- handled in select statements only