If you pass the db connection to defqueries, you are essentially storing 
global state. The point of component is to not have global state. So yeah, 
you shouldn't pass the db-connection to defqueries, but pass the connection 
to every db-call.

fredag 9. oktober 2015 03.01.29 UTC+2 skrev Charles Harvey III følgende:
>
> That's what I have now and I was wondering if it could/should change now 
> that I can pass the connection into defqueries. It seems like it could 
> change. But, component is just a place to keep state/global values. The 
> connection being one of them. defqueries must be storing it somewhere (an 
> atom?) but if component already has it than I do not need to give it to 
> yesql to hold as well.
>
> Does this all sound right?
>
> Thanks.
>
>
>
>
> On Thursday, October 8, 2015 at 3:48:33 PM UTC-4, Robin Heggelund Hansen 
> wrote:
>>
>> For a component-based workflow, you wouldn't send in the db-spec with the 
>> defqueries. You would do it when calling a query.
>>
>> (defqueries "somepath")
>>
>> (defn code [component]
>>   (some-query {:name "Robin", :age 6} {:db (:db-spec component)}))
>>
>> torsdag 8. oktober 2015 15.34.09 UTC+2 skrev Charles Harvey III følgende:
>>>
>>> I have a question that I hope you can answer about using Yesql with 
>>> Component.
>>>
>>> Currently I pass the db-spec into my endpoint and then pass it into each 
>>> call to a query. Now that I can call defqueries with the db-spec, how do I 
>>> send that in from component? Sorry for asking, I am new to both libraries 
>>> and am still learning.
>>>
>>> Thanks.
>>>
>>>
>>>
>>> On Wednesday, October 7, 2015 at 5:55:11 PM UTC-4, Kris Jenkins wrote:
>>>>
>>>> Yesql - the Clojure library for using SQL - has just released v0.5.1.
>>>>
>>>> The API is much improved - especially if you're using queries with many 
>>>> arguments - so see the migration guide if you're upgrading:
>>>>
>>>> My thanks to everyone who has contributed to this release, and for all 
>>>> the users who've been patiently waiting for v0.5 to go official. :-)
>>>>
>>>> Kris
>>>>
>>>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to