Skip to content

Instantly share code, notes, and snippets.

@jlongster
Created January 27, 2016 01:13
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jlongster/570a9249e8648ed73a9a to your computer and use it in GitHub Desktop.
query-sql.txt
% curl -d"[{:transactions [:description :amount]}]" http://localhost:4000/query-raw
{:transactions
[{:amount 3.5, :description "coffee"}
{:amount 7, :description "book"}
{:amount 12.1, :description "lunch"}
{:amount 9.44, :description "shirt"}]}
% curl -d"[{:transactions [:amount {:from_acct [:name]}]}]" http://localhost:4000/query-raw
{:transactions
[{:from_acct [{:name "income"}], :amount 3.5}
{:from_acct [{:name "income"}], :amount 7}
{:from_acct [{:name "income"}], :amount 12.1}
{:from_acct [{:name "income"}], :amount 9.44}]}
% curl -d"[:transactions]" http://localhost:4000/query-raw
{:transactions
[{:from_acct [{:balance 0, :id 4, :name "income"}],
:id 1,
:to_acct [{:balance 0, :id 1, :name "bank of america"}],
:amount 3.5,
:date 1453243176928,
:description "coffee"}
{:from_acct [{:balance 0, :id 4, :name "income"}],
:id 2,
:to_acct [{:balance 0, :id 2, :name "chase"}],
:amount 7,
:date 1453243176928,
:description "book"}
{:from_acct [{:balance 0, :id 4, :name "income"}],
:id 3,
:to_acct [{:balance 0, :id 3, :name "credit"}],
:amount 12.1,
:date 1453243176928,
:description "lunch"}
{:from_acct [{:balance 0, :id 4, :name "income"}],
:id 4,
:to_acct [{:balance 0, :id 1, :name "bank of america"}],
:amount 9.44,
:date 1453243176928,
:description "shirt"}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment