Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-27 Thread Kris Jenkins
Hi Paul, Good catch. The call to lazy-seq was a bit of a hangover from an earlier implementation. I've just pushed v0.2.2 to clojars to fix. Thanks for flagging it up. Cheers, Kris On Saturday, 23 November 2013 01:02:08 UTC, Paul Samways wrote: > > (premature send, sorry) > > For example: > >

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-22 Thread Paul Samways
(premature send, sorry) For example: (sql/db-transaction [t (db/connection)] (select-users t)) will cause a NullPointerException as the query doesn't get executed until after the transaction is commited. Adding a (doall), or actually using the result in the form obviously works around this, but

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-22 Thread Paul Samways
Great work Kris, provides just enough abstraction over jdbc without getting in the way. One question though, and this may be just because I am relatively new to Clojure, but making the returned query lazy seems to be a bit of a gotch'ya. For example: On Mon, Nov 11, 2013 at 10:10 PM, Kris Jenki

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Gary Johnson
Hi Ray, Although the sql-phrasebook does capture much of the same philosophy behind Yesql (and has the excellent feature that we can store multiple SQL queries in the same file), its syntax is somewhat more unpleasant to my eyes than Yesql's macro api. yesql - (defquery user

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Jeremy Heiler
On Mon, Nov 18, 2013 at 6:01 AM, Kris Jenkins wrote: > On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote: > >> Very cool. Do you have any thoughts on a caching strategy? >> > > Yes, for the next version. At the moment it's only changing when the > defquery is re-eval'd. That's right fo

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Ray Miller
Hi Gary et al, On 15 November 2013 23:55, Gary Johnson wrote: > I really like your approach, but I've also been feeling the burn a bit > with having to store each SQL query in its own file (especially since my > data exploration frequently leaves me cataloging hundreds of them). Take a > look at

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Kris Jenkins
Not yet. That's in the works for the next version. :-) On Monday, 18 November 2013 11:02:07 UTC, Josh Kamau wrote: > > Can i put more than one sql statement in a file? > > Josh > > > On Mon, Nov 18, 2013 at 2:01 PM, Kris Jenkins > > > wrote: > >> >> >> On Monday, 18 November 2013 03:21:12 UTC,

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Josh Kamau
Can i put more than one sql statement in a file? Josh On Mon, Nov 18, 2013 at 2:01 PM, Kris Jenkins wrote: > > > On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote: > >> On Mon, Nov 11, 2013 at 6:10 AM, Kris Jenkins wrote: >> >>> https://github.com/krisajenkins/yesql >>> >>> Yesql is

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Kris Jenkins
On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote: > > On Mon, Nov 11, 2013 at 6:10 AM, Kris Jenkins > > > wrote: > >> https://github.com/krisajenkins/yesql >> >> Yesql is a simple library for blending SQL & Clojure together, cleanly. >> Here's how it works

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-18 Thread Kris Jenkins
Hi Gary, Yeah, you're not the only one to say it, and I think you're all right. Thanks for the link to sql-phrasebook. I'm going to take it to the hammock and consider v0.3.0. :-) Cheers, Kris On Friday, 15 November 2013 23:55:46 UTC, Gary Johnson wrote: > > Hi Kris, > > I really like your a

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-17 Thread Jeremy Heiler
On Mon, Nov 11, 2013 at 6:10 AM, Kris Jenkins wrote: > https://github.com/krisajenkins/yesql > > Yesql is a simple library for blending SQL & Clojure together, cleanly. > Here's how it works , > and how to use it

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-15 Thread Gary Johnson
Hi Kris, I really like your approach, but I've also been feeling the burn a bit with having to store each SQL query in its own file (especially since my data exploration frequently leaves me cataloging hundreds of them). Take a look at the approach used in sql-phrasebook: https://github.co

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-12 Thread Kris Jenkins
It depends on which kind of composability you mean. If we're talking about a "SELECT ... FROM ..." here with a "WHERE ..." there, I don't see why not. It's a down-the-road feature, but I'm open to it. But the kind of composability that would get me excited is the cascalog/datalog kind. Where yo

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-12 Thread Kris Jenkins
My primary motivation is for smoother development. Both the editors I use have good SQL modes that do more than just highlighting - they take care of schema exploration, autocomplete, indentation, memorising bind parameters, previewing results, etc. I want to use them to develop a SQL query as a

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-12 Thread Mamun
Hi Kris, I am not sure about that. On the other hand, it will be boring to write 20 query in 20 different files. Could you please check: https://developers.google.com/closure/templates/docs/helloworld_js Here comment contains meta data for core part. Similarly, query'd contain meta data in c

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread John D. Hume
For me, the one feature that can justify an internal DSL for generating SQL is the ability to compose queries. I assume that's not on the Yesql roadmap. On Nov 11, 2013 5:10 AM, "Kris Jenkins" wrote: > https://github.com/krisajenkins/yesql > > Yesql is a simple library for blending SQL & Clojure

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Jeff Heon
In Java land at work,We use Spring jdbc templates and we inject the SQL queries in a map from a single .xml or property file. Queries are accessed from the map with key names like "selectAddressesForClient." Perhaps a similar query lookup scheme could optionally be used with Yesql. -- -- You

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Brian Craft
What prevents you from formatting the example with the clojure string of sql like the example with the separate file of sql? Is the separate file just for the sake of syntax highlighting? On Monday, November 11, 2013 8:52:01 AM UTC-8, Kris Jenkins wrote: > > Hi Mamun, > > Hmm...I hadn't planned

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Brian Craft
On Monday, November 11, 2013 12:57:55 PM UTC-8, Luc wrote: > > Ha ! Ha ! Never thought of this approach and frankly it's the simplest > one. > > We create various db adapters and we routinely have to switch between > raw SQL statements and express them to run from Clojure and it's been an > e

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Softaddicts
Ha ! Ha ! Never thought of this approach and frankly it's the simplest one. We create various db adapters and we routinely have to switch between raw SQL statements and express them to run from Clojure and it's been an extra step that yields zero value. Not as painfull as using an ORM but still

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Manuel Paccagnella
Il giorno lunedì 11 novembre 2013 17:52:01 UTC+1, Kris Jenkins ha scritto: > > Hi Mamun, > > Hmm...I hadn't planned on it, but I could see it would suit some people's > development style. (It could get messy, but so can Clojure namespaces if > you're undisciplined. The developer should be allow

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Kris Jenkins
Hi Mamun, Hmm...I hadn't planned on it, but I could see it would suit some people's development style. (It could get messy, but so can Clojure namespaces if you're undisciplined. The developer should be allowed to take responsibility.) The tricky parts would be: - How would you delimit the

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Mamun
Hi Kris, It's look fine. Is is possible to to add more query in one sql file? I mean- I'd like to create one sql file and store all query on that file. BR, Mamun On Monday, November 11, 2013 2:38:27 PM UTC+1, Kris Jenkins wrote: > > Thanks David, that's nice of you to say. I know exactly what

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Kris Jenkins
Thanks David, that's nice of you to say. I know exactly what you mean - I didn't want to be the guy to write yet another Clojure/SQL library - but when I figured out why none of the existing ones was working for me, I had no choice. :-D There's still plenty that can be done with the implementat

Re: [ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Dave Della Costa
I was about to be like, "oh no, not another one!" and then I read the README and I thought, "oh, interesting... So, kudos on thinking outside the box. I certainly agree with a lot of the points you've made. I'll definitely be playing around with this. Cheers, DD (2013/11/11 20:10), Kris Jenkin

[ANN] Yesql 0.2.1 - Clojure & SQL queries rethought.

2013-11-11 Thread Kris Jenkins
https://github.com/krisajenkins/yesql Yesql is a simple library for blending SQL & Clojure together, cleanly. Here's how it works , and how to use it . Feedback welcomed, Kris -- -- You rece