honza / anosql

Easy SQL in Python
Other
208 stars 29 forks source link

Release new version #14

Closed dimitri closed 7 years ago

dimitri commented 7 years ago

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

Release time?

honza commented 7 years ago

I just shippped 0.2.0. Thanks!

dimitri commented 7 years ago

Thanks for the quick reaction, keep up the good work ;-)

dimitri commented 7 years ago

Covering AnoSQL on my blog: http://tapoueh.org/blog/2017/06/how-to-write-sql/ --- thanks again! ;-)