<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Mike McGonagle</b> <<a href="mailto:mjmogo@gmail.com">mjmogo@gmail.com</a>><br>Date: Dec 10, 2007 1:07 PM
<br>Subject: Re: [PD] [psql] object hand-holding<br>To: <a href="mailto:jamie@postlude.co.uk">jamie@postlude.co.uk</a><br><br></span><br><br><div><span class="q"><span class="gmail_quote">On 12/10/07, <b class="gmail_sendername">
Jamie Bullock</b> <<a href="mailto:jamie@postlude.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jamie@postlude.co.uk</a>> wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Good point! I think Hans' recent suggestion addresses the problem. It<br>also occurs to me that for Postgres at least, we have the PREPARE<br>statement, which addresses the optimisation and injection issues you<br>have raised. Technically [psql] already supports PREPARE except that
<br>PREPARE uses the '$' character as its placeholder identifier, and '$1'<br>can't be passed around as a symbol in Pd. I think it might be<br>interesting to use the '?' notation currently under discussion as an
<br>interface to PREPARE though.</blockquote><div><br> </div></span><div>One of the things that I have been reading on this is that when you use these 'pre-complied' SQL statements, you need to 'bind' each of the variables with their types to a specific function. (Also, I kind of like the ':' syntax, as it puts a name to the data within the statement.) I also think that we would need to do something like
</div><div><br> </div><div>[insert into table (id, name) values (:id, :name) ( <-- sent to the cold inlet</div><div>[bind :id float( <-- sent to hold inlet</div><div>[bind :name symbol( <-- sent to hold inlet
</div><div><br> </div><div>[:id 1 ( <-- sent to hold inlet</div><div>[:name john ( <-- sent to hold inlet</div><div>[bang ( <-- sent to hold inlet</div><div><br>
</div><div>and then we would be able to put all the data into the database with the expected types. At least SQLite and libdbi use these 'bind' functions to associate the expected datatype with the input data.</div>
<span class="sg">
<div><br> </div><div>Mike</div></span><span class="q"><div><br> </div><div> </div><br><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
Jamie<br><br>--<br><a href="http://www.postlude.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">www.postlude.co.uk</a><br><br><br>_______________________________________________<br><a href="mailto:PD-list@iem.at" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
PD-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management ->
<a href="http://lists.puredata.info/listinfo/pd-list" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://lists.puredata.info/listinfo/pd-list</a><br></blockquote></span></div><br><br clear="all">
<div><span class="e" id="q_116c57447c4d2aa6_6"><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
</span></div><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