common_schema, revision 218 is released, with major new features, top one being server side scripting. Here are the highlights:
- QueryScript: server side scripting is now supported by common_schema, which acts as an interpreter for QueryScript code.
- Throttling for queries is now made available via the throttle() function.
- Enhancements to processlist-related views, including the new slave_hosts view.
- Inline documentation/help is available via the help() routine.
common_schema makes for a QueryScript implementation for MySQL. You can run server side scripts, interpreted by common_schema, which allow for easy syntax and greater power than was otherwise previously available on the MySQL server. For example:
foreach($table, $schema, $engine: table like '%') if ($engine = 'ndbcluster') ALTER ONLINE TABLE :$schema.:$table REORGANIZE PARTITION;
QueryScript includes flow control, conditional branching, variables & variable expansion, script throttling and more.
Read more on common_schema's QueryScript implementation.
Throttling for MySQL queries was suggested by means of elaborate query manipulation. It is now reduced into a single throttle function: one can now just invoke throttle(3) on one's query, so as to make the query execute for a longer time, while taking short sleep breaks during operation, easing up the query's demand for resources.
Read more on query throttling.
The processlist_grantees view provides with more details on the running processes. slave_hosts is a new view, listing hostnames of connected slaves.
Read more on process views.
The common_schema documentation is now composed of well over 100 pages, including synopsis, detailed internals discussion, notes and examples. I can't exaggerate in saying that the documentation took the vast majority of time for this code to release.
The documentation is now made available inline, from within you mysql client, via the help() routine. Want to know more about redundant (duplicate) keys and how to find them? Just type:
and see what comes out!
The entire documentation, which is available online as well as a downloadable bundle, is embedded into common_schema itself. It's rather cool.
common_schema is tested. The number of tests in common_schema is rapidly growing, and new tests are introduced for new features as well as for older ones. There is not yet full coverage for all views, but I'm working hard at it. common_schema is a robust piece of code!
Download common_schema on the common_schema project page.
Read the documentation online, or download it as well (or call for help())
common_schema is released under the BSD license.