Planet MySQL Planet MySQL: Meta Deutsch Español Français Italiano 日本語 Русский Português 中文
10 Newer Entries Showing entries 31 to 40 of 63 10 Older Entries

Displaying posts with tag: plugins (reset)

Python Scripting in Workbench
Employee_Team +0 Vote Up -0Vote Down

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

  [Read more...]
Re: Are MySQL stored procedures slow?
+0 Vote Up -0Vote Down
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





  [Read more...]
MySQL Workbench - LUA-Script For Batch Renaming Of Foreign Keys
Employee_Team +0 Vote Up -0Vote Down

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

  [Read more...]
Table functions in MySQL
+0 Vote Up -0Vote Down
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
Employee_Team +0 Vote Up -0Vote Down

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

  [Read more...]
A Utility Library for MySQL Workbench
Employee_Team +0 Vote Up -0Vote Down

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

  [Read more...]
Automate Figure Arrangement In Workbench
Employee_Team +0 Vote Up -0Vote Down

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

  [Read more...]
Re: For Internal Use Only - FAIL
+0 Vote Up -0Vote Down
In response to Monty Taylor's blog post ...I am the culprit for the content of plugin.h which has the comment "the following declarations are for internal use only" which was introduced into the MySQL server codebase a couple of years ago.Unfortunately, I had to work with the limitations of the C programming language and its preprocessor so to achieve a solution which behaved as if it had the
Amira has landed
+0 Vote Up -0Vote Down
What or who is Amira?Well... Many would know Amira is to David as My is to Monty.Amira also has all the same letters as Maria, except that it is in PDP "middle-endian" byte order.It is also the codename of a little known project while I was at MySQL: Soon after Oracle acquired Innobase OY, the powers that be at MySQL did not want to solely rely on InnoDB (or BerkeleyDB) as a transactional data
MySQL plugins - the missing plug.in manual page.
+0 Vote Up -0Vote Down
A whole bunch of people have successfully written plugins for MySQL using the plug-in framework which first appears in MySQL 5.1. On the whole, the simple examples work great, as long as all your code is in one directory. Here is a helpful tip...Inside the plug.in file, you can use MYSQL_PLUGIN_DIRECTORY_<FOO> as an alias to the directory in which your plug.in is located within, where FOO is the
10 Newer Entries Showing entries 31 to 40 of 63 10 Older Entries

Planet MySQL © 1995, 2014, Oracle Corporation and/or its affiliates   Legal Policies | Your Privacy Rights | Terms of Use

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.