(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 class="webkit-block-placeholder"></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 class="webkit-block-placeholder"></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 class="webkit-block-placeholder"></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 class="webkit-block-placeholder"></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 class="webkit-block-placeholder"></div><div>*************************</div><div><br class="webkit-block-placeholder"></div><div>Does this sound about right? I would like to have a clear outline before I start coding anything.
</div><div><br class="webkit-block-placeholder"></div><div>Thanks,</div><div><br class="webkit-block-placeholder"></div><div>Mike</div><div><br class="webkit-block-placeholder"></div>