I am playing with anosql that I installed from pip. I like this library and got to discover it thanks to the YeSQL project for Clojure. I see the current tree implements support for named arguments in the queries, like :n. Which is pretty cool because it is compatible with psql variables:
psql --variable "n=10" -f foo.sql <dbname>
Given for example:
-- name: top-artists-by-album
-- Get the list of the N artists with the most albums
select artist.name, count(*) as albums
from artist
left join album using(artistid)
group by artist.name
order by albums desc
limit :n;
You can test your queries interactively (and also use \set and \i commands) and then run your application again.
Hi,
I am playing with anosql that I installed from pip. I like this library and got to discover it thanks to the YeSQL project for Clojure. I see the current tree implements support for named arguments in the queries, like
:n
. Which is pretty cool because it is compatible withpsql
variables:Given for example:
You can test your queries interactively (and also use
\set
and\i
commands) and then run your application again.Release time?