Voile.Plugins (Voile v0.1.23)

Copy Markdown View Source

Context for managing plugin records in the Voile database.

Summary

Functions

Delete a plugin record by plugin_id. Used during uninstall when remove_data is true.

Get a plugin by its primary key.

Get a plugin by its unique plugin_id.

Get a single setting value for a plugin. Returns default if plugin or key not found.

List all plugins ordered by name.

List plugins filtered by status.

Update a single setting using JSONB merge to avoid race conditions.

Update multiple settings at once using JSONB merge.

Update the status of a plugin by plugin_id. Optionally accepts an error_message for :error status. Automatically sets activated_at or deactivated_at timestamps.

Insert or update a plugin record based on plugin_id. If the plugin_id exists, updates the existing record.

Functions

delete_plugin(plugin_id)

Delete a plugin record by plugin_id. Used during uninstall when remove_data is true.

get_plugin!(id)

Get a plugin by its primary key.

get_plugin_by_plugin_id(plugin_id)

Get a plugin by its unique plugin_id.

get_plugin_setting(plugin_id, key, default \\ nil)

Get a single setting value for a plugin. Returns default if plugin or key not found.

list_plugins()

List all plugins ordered by name.

list_plugins_by_status(status)

List plugins filtered by status.

put_plugin_setting(plugin_id, key, value)

Update a single setting using JSONB merge to avoid race conditions.

put_plugin_settings(plugin_id, settings_map)

Update multiple settings at once using JSONB merge.

update_plugin_status(plugin_id, status, opts \\ [])

Update the status of a plugin by plugin_id. Optionally accepts an error_message for :error status. Automatically sets activated_at or deactivated_at timestamps.

upsert_plugin(attrs)

Insert or update a plugin record based on plugin_id. If the plugin_id exists, updates the existing record.