botkit icon indicating copy to clipboard operation
botkit copied to clipboard

Storage documentation is incorrect

Open leighman opened this issue 7 years ago • 7 comments

In the storage section of the README it mentions that storage backends should implement delete methods. None of the available backends implement delete nor can I find it in the internal implementation. The documentation needs to be updated presumably.

leighman avatar Feb 28 '17 10:02 leighman

There is at least an implementation in "simple storage" but I am confused as to what the intended api should be. The implementation I linked to says that delete should take an id but in actuality it takes the whole object. The test cases don't actually use delete so I can't tell what they think it should be. Any insights?

barlock avatar Mar 07 '17 21:03 barlock

I can confirm that all of the botkit-storage-* in the howdyai org don't seem to implement delete. Redis implements remove though and takes an id rather than the whole object

barlock avatar Mar 07 '17 21:03 barlock

Is this fixed? https://github.com/howdyai/botkit/pull/854

peterswimm avatar Sep 21 '17 15:09 peterswimm

I'm not sure from the comments: should we have delete methods? I'm needing them on MongoDB storage and i'm not sure if I should create a PR here in the project or should place it only inside my custom code.

What do you think?

pedrorocha-net avatar Nov 05 '17 18:11 pedrorocha-net

The Jabber bot looks like it requires both 'delete' and 'all' to be implemented for storage methods. CoreBot already checks for the existence of 'get' and 'save', but not 'delete' and 'all'. Checks for 'delete' and 'all' could be added to the CoreBot (which might be a breaking change), placed in the Jabber bot, or the documentation updated to include either indicating that Jabber will only work with some storage mechanism implementations, or for the storage mechanisms indicating what methods that they should implement.

It looks like the Mongo storage implements all four methods now, as does Redis (except that 'delete' is 'remove'), and Datastore and Firebase do not implement 'delete'.

fastbean-au avatar Oct 02 '18 08:10 fastbean-au

Looking at the other plugins (those listed here):

CouchDB and Datastore support all four methods Firestore, MySQL and Postgres (not maintained) do not support 'delete'

fastbean-au avatar Oct 03 '18 07:10 fastbean-au

hey @fastbean-au are you a member of community.botkit.ai? you should join if not!

benbrown avatar Oct 19 '18 18:10 benbrown