<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<br><div><div>On Dec 10, 2007, at 3:57 PM, Mike McGonagle wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br><br><div><span class="gmail_quote">On 12/10/07, <b class="gmail_sendername">Hans-Christoph Steiner</b> &lt;<a href="mailto:hans@eds.org">hans@eds.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> <div style="word-wrap:break-word"><div>(What is the "hold" inlet, by the way?)</div></div></blockquote><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>It's a hot inlet that has been misspelled... </div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>It would be really nice to be able to have inlets for the sql placeholders, but I couldn't think of a clean way to do it.  We could try the dynamic allocation like you say here, I don't know if I have a specific objection to it, but it could get weird.  Since the SQL inlet has to be cold to support the comma hack, then these dynamic inlets  shouldn't be hot since they are the right of a cold inlet.   But that's not a big deal. </div></div></blockquote><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>And if you want placeholders to have inlets, then we are back to putting the SQL into the object creation arguments, like: </div><div><br class="webkit-block-placeholder"></div><div>[sqlite insert into table (id, name) values (:id, :name)]</div><div><br class="webkit-block-placeholder"></div><div>While I don't think it is a bad idea, it does restrict a particular instance of a database object to only a single type of message, and it would have to be done at creation time of the object. </div><div><br class="webkit-block-placeholder"></div><div>Should we allow both methods of entering SQL? One done at creation time, the other one done on the fly? </div></div></blockquote><br><blockquote type="cite"><div><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Also, I don't know if any objects do this kind of dynamic inlet creation after the object itself has been instantiated.  It might not even be possible.  I figure that you can easily make a subpatch or abstraction around the SQL message generation, then manage the inlets there.  Perhaps not ideal, but it's not difficult to do and follows existing practice. </div></div></blockquote><div><br> </div><div>I would think that an object having the ability to change its inlets on the fly would NOT be possible, as the inlets may change so much, as to lose a connection when it is recreated. </div><div><br class="webkit-block-placeholder"></div><div>OR, could we possibly do something like this</div><div><br class="webkit-block-placeholder"></div><div>[sqlite :id(f) :name(s)]</div><div><br class="webkit-block-placeholder"> </div><div>Which would create an instance with 4 inlets, the first 'hot' inlet would accept all the control messages, the next (x number) would represent the bound inlets for the placeholders, and the last would be the inlet for the incoming SQL statement. Would it be an error if the incoming SQL statement didn't have the same placeholders defined in it? Or should it be allowed to operate as any other? </div></div></blockquote><div><br class="webkit-block-placeholder"></div><div>This kind of thing could be done in a separate "query" object, like what's included in the "sqlwrappers", and [sqlite]/[psql] would still represent the database itself.  Having the objects structured this way means that Matju could write his [expr] SQL query too, and they would work with the different SQL database objects (sqlite, psql, mysql).</div></div><div><br class="webkit-block-placeholder"></div><div><blockquote type="cite"><div><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>As for the SQL binding, I was thinking it would happen inside of the object, binding the placeholder names to the selectors.  As long as there wasn't any new input on the SQL inlet, then the SQL statement wouldn't need to be recompiled. </div></div></blockquote><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>My thought too... </div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"> <div style="word-wrap:break-word"><div>Another question I just thought of it how to handle returning multiple results from s single query.  If it followed the [textfile] style, then you would have to bang to get each individual result, then keep banging until you get a bang on the status/second outlet, meaning the query was done.  I think this could work. </div></div></blockquote><div><br class="webkit-block-placeholder"></div><div>This is already what I have been doing. Basically, as we are working now, the SQL would get input on the right inlet, then if any binding were needed, that would be done, and when the next bang occurs, the query is submitted, and the first result set is returned. Any subsequent bang would return the next result set. And when the result sets have been exhausted, it would send a bang out the "status" outlet to indicate the sets are done.</div></div></blockquote><div><br class="webkit-block-placeholder"></div><div>Cool, that sounds like a good idea.  I probably got it from you. :)  Maybe you are already doing this, but a query could also send a message out of the status outlet to say how many results were found (i.e. [results 5().  This number could be routed to trigger an [until] or other such behaviors.  (using the completion bang to stop [until] probably makes more sense though).</div><div><br class="webkit-block-placeholder"></div><div>.hc</div><div><br class="webkit-block-placeholder"></div><br><blockquote type="cite"><div><div> </div><div> </div>Mike</div><div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>.hc</div><div><span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> <span style="border-collapse:separate;border-spacing:0px 0px;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"> <div><br style="font-family:Tahoma"></div><div>----------------------------------------------------------------------------</div><div><br style="font-family:Tahoma"></div><div>There is no way to peace, peace is the way.       - A.J. Muste</div><br></span></span> </div><br> </div></blockquote></div><br><br clear="all"><br>-- <br>Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal. <br>—Yehudi Menuhin (1916–1999), musician</blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br class="khtml-block-placeholder"></div><div>----------------------------------------------------------------------------</div><div><br></div><div>"[W]e have invented the technology to eliminate scarcity, but we are deliberately throwing it away to benefit those who profit from scarcity."        -John Gilmore</div><br class="Apple-interchange-newline"></span></span> </div><br></body></html>