<br><br><div class="gmail_quote">On Dec 13, 2007 1:59 PM, Mathieu Bouchard &lt;<a href="mailto:matju@artengine.ca">matju@artengine.ca</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="Ih2E3d">On Mon, 10 Dec 2007, Hans-Christoph Steiner wrote:<br><br></div>&gt; The other somewhat common style that I saw in my searches was printf patterns<br>&gt; (%s, %f, etc). &nbsp;In Pd, [makefilename], [makesymbol], [sprintf], and perhaps
<br>&gt; others use this syntax. &nbsp;The single ? notation seems to be supported by at<br>&gt; least these, if you want to call that &quot;specific&quot;: &nbsp;Qt, PerlDBI, Perl&#39;s<br>&gt; DBD::Pg, RubyDBI, PHP PDO, Java JDBC, MySQL, Oracle.
<br><br>Well, maybe I shouldn&#39;t have said &quot;specific&quot;, but when I look at any PHP<br>code that I find, it seems that they haven&#39;t discovered what&#39;s a<br>placeholder yet, for example. So, it seems that it&#39;s not so universal.
</blockquote><div><br class="webkit-block-placeholder"></div><div>As someone who has never really used Placeholders, the only sorts of things that I can see them being useful for are when you need to do a lot of inserts or deletes, or for other statements that will be executed repeatedly. From what I am gathering by these discussions is that the useage of placeholders allows the SQL statement to be &quot;compiled&quot; and then with each execution of the statement, the values of the placeholders are substituted.
</div><div><br class="webkit-block-placeholder"></div><div>This might be one reason you don&#39;t see them all that often in PHP, I would imagine that PHP doesn&#39;t really do a whole bunch of&nbsp;repetitive&nbsp;stuff.</div><div>
&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br>&gt; I think it is quite important to reuse existing syntax rather than<br>&gt; introducing new syntax. &nbsp;Minimal syntax is really one of Pd&#39;s biggest
<br>&gt; strengths. &nbsp;Since these lines would be pure SQL, I think it would be<br>&gt; appropriate to use a common SQL syntax.<br><br>If you wanted to reuse existing Pd syntax, you could abstract out SQL<br>syntax completely and make a database interface that fully feels like Pd.
<br>The Rails web framework has something like that.</blockquote><div><br class="webkit-block-placeholder"></div><div>I don&#39;t know about you guys, but my original goal on this was to basically allow a user to input SQL and it would return the result sets. I just wanted to keep it simple. But I can see a use for using Placeholders, especially when you have a lot of data to store (and it also kind of &quot;vindicates&quot; my original idea of putting the SQL directly in the creation args... [wink, wink, nudge...]).
</div><div><br class="webkit-block-placeholder"></div><div>This idea of doing this to make this more PD-like I think would be a waste of time, as SQL is pretty simple and a LOT of people already know it. Why create another &quot;language&quot;?
</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><br><br>&gt; I just had a thought, SQL injection relies on being able to send semi-colons<br>&gt; in text fields.
<br><br>This is not true. I have already posted an example in this thread on how<br>to delete a whole table using SQL injection without a semicolon.</blockquote><div><br class="webkit-block-placeholder"></div><div>At the same time, should our external be on the look out for these sorts of things? One of the original ideas was to not give the external any, if at all, knowledge of SQL. Meaning, it wouldn&#39;t &quot;parse&quot; the SQL, nor would it try to do any generation of SQL. It just expects that the user is HONEST (that is what these concerns over Injection are, right), and the SQL they entered is what they meant.
</div><div><br></div><div>These things being said, I am not adverse to the new design model, and I hope to get something up over the weekend.</div><div><br class="webkit-block-placeholder"></div><div>While we can try to protect against various things, those that want to be malicious will do so anyway.
</div><div><br class="webkit-block-placeholder"></div><div>Of course, we could eliminate these problems altogether, and just use an embedded database ONLY... (just kidding...)</div><div><br class="webkit-block-placeholder">
</div><div><br class="webkit-block-placeholder"></div><div>Mike</div><div><br class="webkit-block-placeholder"></div></div>