Drizzle Plugin Hacking

From OpenSQLCamp

Jump to: navigation, search

All plugins must have a ini file (ini format) containing things like:

       title
       description
       sources
       cppflags (not the right way to do it)
       ldflags (not the right way to do it)
               Do not hard code these items
               Use autoconf tests instead
       load_by_deffault
       It is nice parser (standard python ini parser).

Can use plugin.am and plugin.ca for more comlpicated builds.

All plugins are instances of subclasses of drizzle classes.

They must be written in C++.

Great way to start is to take someone elses code and hack on it.

Will always need to include:

       drizzled/server_includes.h
       drizzled/gettext.h

The drizzled/plugin directory contains all classes describing plugin classes.

Remember warnings = errors. Many gotchas as a result.

Need to tell drizzle to use our plugins for stuff.

All plugin libraries have an init method associated with them

       Need to:
       Create new instance of plugin
       Add it to plugin registry in drizzle.

Plugins own their own memory.

The deinit method gets called on shutdown. Need to remove plugin handler and delete it.

Plugins can only be loaded/unloaded at drizzled startup/shutdown.

load_by_default=yes means load even if not specified on the command line when starting drizzled.

A flag that says load all default plugins but this one should be added to drizzled.

The word "plugin" is ludicrously overloaded.

Will eventually add a plugin library that allows you to build plugins with any language.

drizzle_declare_plugin contains a description of the plugin

There are a few differences between mailine trunk and what we covered. This will be fixed soon.

Personal tools