title: Is there a set of complete documentation for mysql-proxy lua scripting?
body: <p>I am playing with scripting for mysql-proxy.  What I am trying to accomplish is irrelevant.  What I am finding, however, is that there appears to be elements of the lua interface that are undocumented.  The big "smoking gun" I have is the <code>disconnect_client()</code> hook.  I cannot find it documented anywhere in <a href="http://dev.mysql.com/doc/refman/5.5/en/mysql-proxy.html" rel="noreferrer">the official documentation</a>, though it's used in an example on the <a href="http://dev.mysql.com/doc/refman/5.5/en/mysql-proxy-using-admin.html" rel="noreferrer">explanation of the admin interface</a>.  It's also used extensively in the example docs.  A quick grep shows its use in the following scripts included in the 5.5.8 distribution:</p>
  
  <p>active-queries.lua<br>
  active-transactions.lua<br>
  load-multi.lua<br>
  ro-pooling.lua<br>
  rw-splitting.lua<br>
  tutorial-keepalive.lua  </p>
  
  <p>My other example that has caught my eye is the list of attributes for entries in the <code>proxy.global.backends</code> table.  The <a href="http://dev.mysql.com/doc/refman/5.5/en/mysql-proxy-scripting-structures.html" rel="noreferrer">documentation</a> lists the following attributes:</p>
  
  <pre><code>dst.name
  dst.address
  dst.port
  connected_clients
  state
  type
  </code></pre>
  
  <p>However, several of the example scripts reference a fairly complex element called pool.  Take for instance <code>tutorial-keepalive.lua</code>:</p>
  
  <pre><code>local s = proxy.global.backends[i]
  local pool     = s.pool
  local cur_idle = pool.users[proxy.connection.client.username].cur_idle_connections
  </code></pre>
  
  <p>At first I thought it was being added somewhere else in the lua, but I've looked and I can't find any code assigning into proxy.global.backends[i].pool.</p>
  
  <p>So, two questions I suppose:</p>
  
  <ol>
  <li>Am I nuts?  Please feel free to demonstrate how I've overlooked the obvious and the documentation is really quite clear.</li>
  <li>Assuming I am correct, is there anywhere to find the complete documentation?  A nice link would be great (though I couldn't google one up), but even "take a look at this .c file from the mysql-proxy distro that defines the interface".  At least that would give me something to poke at.</li>
  </ol>
  
  <p>Thanks</p>