orama icon indicating copy to clipboard operation
orama copied to clipboard

Standardised API Access To Database

Open adrian-goe opened this issue 2 years ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. Having Stored twice is redundant and results effort to synchronising

Describe the solution you'd like An standardised API to write Database Adapters as a source to search. Then all Databases could have a custom fitting Adapter. This would enable searching on top of a database of any type. This could be Postgres, MongoDB or even indexDB in the browser.

I'm aware that this would make search slower, but would be optional and this tradeoff may be worth for some projects.

adrian-goe avatar Nov 29 '22 12:11 adrian-goe

Hi @adrian-goe , that's actually a good proposal, thanks! Do you have any reference we can follow to understand your desired API?

micheleriva avatar Nov 29 '22 14:11 micheleriva

I'm not so firm in creating/designing an plugin system like this. Also not, how Lyra works internally. But I would assume something like nelify-cms do with their backends? see every netlify-cms-backend-... package -> https://github.com/netlify/netlify-cms/tree/master/packages

Its not documented at this moment, but basically, the provide an Interface and this needs to be implemented. The implemented class is the registered and used.

I guess, this adapter would be implemented per structure?

The more I think about this, the more complicated it gets 🙈 Like, dose lyra need to store metadata -> maybe the database has to provide a table for this? what about updates in the data, dose lyra needed to be informed about this?

I am willing to help and think about this, but I guess, i need to know lyras internals in the first place

adrian-goe avatar Nov 29 '22 15:11 adrian-goe