joshmn / ahoy_captain

A full-featured, mountable analytics dashboard for your Rails app, powered by the Ahoy gem.
MIT License
356 stars 18 forks source link

MySQL support? #43

Open deadroxy opened 4 months ago

deadroxy commented 4 months ago

Any chance you're planning to add support MySQL databases?

I played around a bit and it's close to working out of the box except the JSONB_EXISTS and jsonb_object_keys methods which are Postgres specific. I have a JSON column in my database and apart from the missing methods, it seems like it could work. MySQL 8 introduced the JSON_CONTAINS_PATH method and JSON_EXTRACT has been available since v5. Either of those will work to check if a key exists. And the JSON_KEYS function allows for access to the key value store.

Looks like support for MySQL databases would be possible, but it would require a bunch of refactoring to allow for choosing different database adapters. I'll tinker around a bit more myself to see if I can get a fork working for my application, but it would be great to know if others are doing anything similar!