Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding plugin-based key-value store to SopelDB #1501

Closed
half-duplex opened this issue Mar 14, 2019 · 3 comments · Fixed by #1621
Closed

Adding plugin-based key-value store to SopelDB #1501

half-duplex opened this issue Mar 14, 2019 · 3 comments · Fixed by #1621
Assignees
Milestone

Comments

@half-duplex
Copy link
Member

I maintain a plugin that needs to persist some values between bot executions. This data is not specific to any channel or nickname, so the existing bot.db.{set,get}_{nick,channel}_value() functions aren't optimal, as they would require fabricating a channel or user, which has other implications including potential collisions. My interim solution of writing the values to the bot.config.pluginname is dirty since these values aren't things the bot owner should need to care about.

Proposed are the following methods within SopelDB:

get_plugin_value(plugin, key)
    """Retrieves the value for a given key associated with a plugin name."""

set_plugin_value(plugin, key, value)
    """Sets the value for a given key to be associated with the plugin name."""
@dgw
Copy link
Member

dgw commented Mar 21, 2019

We have already nick_values and channel_values tables, so logically adding a plugin_values table would make sense for this.

Does it need any columns besides plugin, key, and value? All probably type STRING.

Work on this would need to coordinate with #1446, probably by waiting to start implementation until the conversion to SQLAlchemy is done (then this only has to be implemented once, on the new architecture).

@dgw dgw added this to the 7.0.0 milestone Mar 21, 2019
@dgw
Copy link
Member

dgw commented May 27, 2019

I neglected to mention, #1446 is merged, completing the move to SQLAlchemy.

@deathbybandaid
Copy link
Contributor

I'll take a stab at this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants