staticbackendhq / core

Backend server API handling user mgmt, database, storage and real-time component
https://staticbackend.com
MIT License
700 stars 66 forks source link

[WIP] Support for PostgreSQL, abstraction for data persistance #28

Closed dstpierre closed 2 years ago

dstpierre commented 2 years ago

This PR introduce a data persistance interface Persister which is use to add support for PostgreSQL.

The current MongoDB implementation is refactored into database/mongo and the new PostgreSQL implementation will be in database/postgresql.

MongoDB's type and queries are all over the place in the code base. Sub packages like functions and cache are directly calling MongoDB. Lots of dependencies injection will need to be thought carefully, maybe some re-design.

The main goal though is to not touch the public API, so those changes ideally would not break current installs.