Comment

Comment by swannodette

But your missing the point. You can store parts of queries and reuse them, recombine them however you see fit:

  (def users (cql/table db :users))
  (def photos (cql/table db :photos))

  (def users-and-photos
     (cql/join users photos
               (cql/where (= :users.id :photos.user_id))))
  
  (def photo-titles
     (-> users-and-photos
         (cql/project #{:photos.title})))
Note that my queries just keep getting smaller and smaller ;) By writing the mundane portions of your SQL queries again and again by hand you will have more duplication.
parent swannodette 16 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton