Showing entries 41 to 50 of 76
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: plugins (reset)
Perl Stored Procedures for MySQL

Files used in conference presentation here: UC2009 presentationI think todays presentation for Perl Stored Procedures for MySQL was quite successful. The audience was quite engaged and asked questions throughout (yes, I invited questions through the talk). I made sure to mention Eric Herman's Java plugin because even though he didn't get time to submit a talk, the work is noteworthy. Sometimes I

External Stored Procedures for MySQL

Finished my presentation earlier this afternoon. I had a better audience than last year and there was interest in the download URL for the source tarballs so I hope to see people hacking on it soon.The link to the presentation is here.There has been lots of good communication with staff from MySQL^WSun Microsystems^W^WOracle so maybe we shall see this code to begin to be integrated soon. In other

MySQL 5.1.32 + External Stored Procedures

I have synced the codebase with the 5.1.32 release of MySQL and it appears to work just fine. Sometimes frustrating that Bazaar takes a bizarre amount of time to do a merge.Download link for the source tarball are available from LaunchPad Download.As an experiment, I have built a Mac OS 10.5 installer package (x86 32bit) which I have also placed there. Took a bit of fiddling about to discover how

Python Scripting in Workbench

Python support has been added to the latest version of MySQL Workbench.

In addition to Lua, you can now write scripts and modules or interact with the GRT shell using the Python language. The integration allows you to use GRT objects and modules mostly in the same way you would do with normal Python objects. The built-in grt module contains everything related to the GRT that’s exposed to Python, including:

  • custom types for GRT lists, dicts and objects
  • wrappers for GRT classes, that can be used and instantiated as a normal Python class;
  • wrappers for registered GRT modules, that can be used like normal modules;
  • a reference to the root node of the GRT globals tree;

You can inspect these objects with the standard dir() command and in some cases with help(), to access the …

[Read more]
Re: Are MySQL stored procedures slow?

In Brooks Johnson's blog posting, Database Science: Are MySQL stored procedures slow?, he mentioned how much slower MySQL's stored procedures are and then compared it with a small piece of .Net code.

Using Perl, a stored procedure which counts to the same value is obviously not going to be as fast as bytecode languages with JIT compilers but it is a lot faster than MySQL's native SQL stored procedures. These perl stored procedures are able to perform dynamic SQL using the familiar DBD::mysql driver without any risk of self-deadlock.

Of course, you can also write stored procedures in Java for many databases but I haven't yet written the neccessary Type 2 JDBC driver to perform a in-thread connection back into the database server to be able to do sophisticated work with MySQL.

[Read more]
MySQL Workbench - LUA-Script For Batch Renaming Of Foreign Keys

Yesterday there was a short discussion on our public IRC channel (#workbench on freenode). It was about how Workbench handles Foreign-Key-Names.

Especially if you intend to use Synchronization feature (available in SE edition only) its good to have names for FKs (and their coresponding Indices). Workbench does that by default if you’re using the Relationship-tools (Hotkeys 1 to 6 when canvas is focused). But if you prefer to create your FKs in a not-so-visual way (entering the values on the FK-Tab in the table-Editor) you are on your own when it comes to naming your FKs. Though Workbench initially only accepts creating keys after you typed a name into the name-field theres still the possibility to rename the FK later to even empty names. If you try to create empty named FKs on a MySQL Server the server will generate a name for the key.

If you want to change FK names later, when your model has already grown to a size, where …

[Read more]
Table functions in MySQL

Less than 48 hours after starting to scratch this itch, I have table functions working in my WL820 repository on Launchpad.It is pretty nifty:mysql> INSTALL PLUGIN Deep_Thought SONAME 'psm_example.so';Query OK, 0 rows affected (0.10 sec)mysql> CREATE FUNCTION test.FooAnswer() -> RETURNS TABLE(answer TEXT) -> NO SQL LANGUAGE Deep_Thought EXTERNAL NAME 'compute';Query OK, 0 rows affected (

Workbench Plugin Tutorial: Load INSERTs from a File

A couple of people have asked for a means to set the list of INSERT statements of a table from data already in an external file. While we haven’t implemented that feature in Workbench as of now, that’s something that can be easily added as a Lua plugin.

The plugin is really simple, but I’ll take the opportunity to use it as a quick tutorial on how to write a plugin from scratch, using the mini-IDE in Workbench 5.0  Note that this tutorial is meant for MySQL Workbench 5.0; Workbench 5.1 has some differences in how plugins are handled and that is not covered here.

1.  Start Workbench and Open the “GRT Shell IDE”

2. Click on “New GRT File” button

3. Select the “Lua GRT Module File” option, “Table_Plugin” template and fill in a name for the file, eg: table_utils

4. …

[Read more]
A Utility Library for MySQL Workbench

Here is a small library with various helpful Lua functions for scripts and plugins for Workbench, making it easier to write your own plugins for exporting to some external format, generating reports etc. The library is meant for Workbench 5.0, but it will be ported to 5.1 as well, which should make transitioning plugins from one to the other somewhat easier in the future. Currently, most functions are meant for iterating through various objects so you can, but new functions will be added every once in a while and contributions, bug fixes and comments are welcome. To “install” the library, place the file in your equivalent for C:\Documents and Settings\user\Program data\MySQL\Workbench\librariesQuick list of places to get useful information for plugin writing:

  • the Structs list will list the available GRT object types and …
[Read more]
Automate Figure Arrangement In Workbench

Initiated by a question on the forum I took some time to exercise my Workbench-Scripting-Knowledge. The question was, if it’s possible to do some figure-arrangement/organizing via scripts. To be more precise, the task I had to master was to get tables that have names starting with a given prefix moved into a new layer using scripts.

The function to create a new object - layer in this case - was an easy one. All you have to do is to use the function grtV.newObj(”workbench.model.Layer”). This function returns a handle to the created Layer. Finally, set the visual properties (color, position) and most important, the owner has to be set to the containing Diagram-object. Last step is to add the layer to the “layers” property of the Diagram-object.
The second step, which i put into a separate function, is to ask the user for the prefix to filter the desired tables/objects that should get grouped onto the new layer. Next, loop …

[Read more]
Showing entries 41 to 50 of 76
« 10 Newer Entries | 10 Older Entries »