Module mariadb::plugin

source ·
Expand description

Module for everything relevant to plugins

Usage:

use mariadb::plugin::*;
use mariadb::plugin::encryption::*;
use mariadb::plugin::SysVarConstString;

static SYSVAR_STR: SysVarConstString = SysVarConstString::new();


// May be empty or not
struct ExampleKeyManager;

impl KeyManager for ExampleKeyManager {
    // ...
}

impl Init for ExampleKeyManager {
    // ...
}

register_plugin! {
    ExampleKeyManager,                           // Name of the struct implementing KeyManager
    ptype: PluginType::MariaEncryption,          // plugin type; only encryption supported for now
    name: "name_as_sql_server_sees_it",          // loadable plugin name
    author: "Author Name",                       // author's name
    description: "Sample key managment plugin",  // give a description
    license: License::Gpl,                       // select a license type
    maturity: Maturity::Experimental,            // indicate license maturity
    version: "0.1",                              // provide an "a.b" version
    init: ExampleKeyManager,                     // optional: struct implementing Init if needed
    encryption: false,                           // set to `false` to use default encryption, `true` if your main
                                                 // struct implements 'Encryption`, and another type
                                                 // if a different type should be used for encryption
    // decryption: DecryptionContext,            // optional field: if `encryption` is specified as a type
                                                 // but the type that implements `Decryption` is different,
                                                 // it can be specified here
    variables: [                                 // variables should be a list of typed identifiers
        SysVar {
            ident: SYSVAR_STR,
            vtype: SysVarConstString,
            name: "sql_name",
            description: "this is a description",
            options: [SysVarOpt::ReadOnly, SysVarOpt::NoCliOption],
            default: "something"
        },
    //     SysVar {
    //         ident: OTHER_IDENT,
    //         vtype: AtomicI32,
    //         name: "other_sql_name",
    //         description: "this is a description",
    //         options: [SysVarOpt::ReqCmdArg],
    //         default: 100,
    //         min: 10,
    //         max: 500,
    //         interval: 10
    //     }
     ]
}

Modules§

Macros§

Structs§

Enums§

  • Defines possible licenses for plugins
  • Defines possible licenses for plugins
  • Defines a type of plugin. This determines the required implementation.
  • Possible flags for plugin variables

Traits§

  • Implement this trait if your plugin requires init or deinit functions