So, I guess I will just assume that this is what we were discussing, until someone tells me different.<div><br class="webkit-block-placeholder"></div><div>Mike</div><div><br><br><div><span class="gmail_quote">On 12/11/07, 
<b class="gmail_sendername">Mike McGonagle</b> &lt;<a href="mailto:mjmogo@gmail.com">mjmogo@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex">
(As the other thread seemed to diverge greatly in topic, I figured this might be a time to branch off and discuss what we are trying to implement)<div><br>&nbsp;</div><div>So, can we take a step back and figure out exactly what we are doing? It seems that even within the thread itself, we have changed the Object Model a LOT... From what I have read, this is what I now understand the model to be...
</div><div><br>&nbsp;</div><div><br>[mySQL-Connection id-symbol &lt;connection info&gt;] &lt;-- a PD object representing connection</div><div><br>
</div><div>[SQL-Query&nbsp;id-symbol &lt;sql statement&gt;] &lt;-- an SQL query object</div><div><br><br>&nbsp;</div><div>&nbsp;</div><div>The first object, the Connection, takes a symbol that identifies itself to PD, and optionally the connection info. The second takes a symbol linking it to a Connection object (this linking can also be changed to point to another connection using a control message), and an optional SQL statement for Placeholder Inlet creation. This method will &quot;bind&quot; those inlets into the SQL statement. If there is no SQL statement, no binding is allowed using that object, and all SQL come to a cold inlet, using PD messages (variable stuff can be put into the statement via PD&#39;s $&nbsp;mechanism).
</div><div><br>&nbsp;</div><div>The connection object responds to the following</div><div>open/connect - to open a file (in an embedded database) or connects to server</div><div>close/disconnect - close the file or breaks the connection
</div><div><br>&nbsp;</div><div>As the connection object can represent any database, its named &lt;dbname-connect&gt;. A MySQL database would be [MySQL-connect ...], sqlite would be [sqlite-connect ...], etc. A connection object provides a single outlet to provide status about the connection (similar to a [netsend] object). There is a single inlet used to control the connection object.
</div><div><br>&nbsp;</div><div>The query object responds to the following</div><div>buffer - to change the size of the&nbsp;SQL&nbsp;input buffer</div><div>results - to change the size of the results buffer
</div><div>bang - submits the initial query, and outputs a result set for each bang</div><div>clear - clears the&nbsp;SQL&nbsp;buffer</div><div>addsemi - appends a semicolon to the&nbsp;SQL&nbsp;buffer</div><div>addcomma - appends a comma to the&nbsp;SQL&nbsp;buffer
</div><div>adddollar - appends a dollar sign to the buffer (do we need this?)</div><div><br>&nbsp;</div><div>If the query is created with an embedded statement, any placeholders will generate an inlet. No cold inlet for SQL will be created.
</div><div><br>&nbsp;</div><div>If the query does not have an embedded statement, it will provide an arbitrary inlet that accepts SQL to process.</div><div><br>&nbsp;</div>
<div>The query object has 3 outlets, the first outputs a list for each result set (on each subsequent bang, very much like a [textfile] object), the second will outlet a float representing the ROWID of the last insert statement, and the third outlet indicates the status of the query, with a bang indicating the end of the result sets, a symbol or a list is a status message from the database.
</div><div><br>&nbsp;</div><div>*************************</div><div><br>&nbsp;</div><div>Does this sound about right? I would like to have a clear outline before I start coding anything.
</div><div><br>&nbsp;</div><div>Thanks,</div><span class="sg"><div><br>&nbsp;</div><div>Mike</div><div><br>&nbsp;</div>
</span><br>_______________________________________________<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:PD-list@iem.at">PD-list@iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -&gt; 
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br><br></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
</div>