<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br class="webkit-block-placeholder"></div><div>I cc'ed the list since I think this is valuable discussion:</div><br><div><div>On Dec 10, 2007, at 7:39 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>It is useful to represent the pieces in Pd space, so you can understand what's going on.  That's one reason why I advocate having the core object represent the connection to the database rather than a query.  Otherwise, it's starts to become more like Max/MSP's mega-objects (coll, zl, etc) that are really like mini-applications than programming.   </div></div></blockquote><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>At the same time, while you seem to want to abstract the query from the database connection objects, SQL is not SQL to all databases. One thing I have noticed is that in SQLite, you would create an autoincremented ID/index field using: </div><div><br class="webkit-block-placeholder"></div><div>CREATE TABLE MINE (</div><div>   id integer primary key autoincrement not null</div><div>);</div><div><br class="webkit-block-placeholder"></div><div>While in MySQL (from what I remember) you do this: </div><div><br class="webkit-block-placeholder"></div><div>CREATE TABLE MINE (</div><div>   id INT auto_increment not null</div><div>PRIMARY KEY(id)</div><div>);</div><div><br class="webkit-block-placeholder"></div><div>(Please not the difference in spelling "autoincrement".) So, while I can understand you desire to abstract these concepts out, I wonder if it would be possible. Also, I don't think that it should be the task of the external to "normalize" what SQL gets entered. One of the original design goals was to NOT have to actually parse the SQL, relying on the user to know what they are doing, and just feed the SQL into the database. </div><div><br class="webkit-block-placeholder"></div><div>I can see that from this thread alone, that this is not going to be possible. Plus, if we are going to implement the idea of "placeholders", that Yes, we will need to be parsing some SQL. </div><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>There still can be query objects, they would just be designed to feed to the core database objects.  These query objects would then be usable if we maintain the same interface. </div></div></blockquote><div><br class="webkit-block-placeholder"></div><div><br class="webkit-block-placeholder"></div><div>And yet, the differences between databases might actually make this difficult at best. That is why I still think there will end up being a different object for 'sqlite', postgres, mysql, etc...</div></div></blockquote><div><br class="webkit-block-placeholder"></div><div>I agree with you.  Ideally, there would be a common SQL, but there is not.  We could try to make a common SQL, I think things like Perl:DBI do that (I could be wrong), but I think that would be a version 2 kind of thing.  We can leave that till later, or perhaps never.</div><div><br class="webkit-block-placeholder"></div><div>I still think we can make a common query object that just handles the placeholders, and otherwise just passed the SQL statements thru.</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><br class="webkit-block-placeholder"></div><div>Mike</div><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"> <span class="sg"><div>.hc</div></span><span class="q"><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"> <br><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> </div><div>----------------------------------------------------------------------------<br> </div><div><br> </div><div>News is what people want to keep hidden and everything else is publicity.          - Bill Moyers </div><br></span></span> </div><br></span></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></div><div>----------------------------------------------------------------------------</div><div><br></div><div>I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers.      - General Smedley Butler</div><br class="Apple-interchange-newline"></span></span> </div><br></body></html>