plutov / formulosity

Self-hosted Surveys as Code platform.
https://formulosity.vercel.app
MIT License
181 stars 20 forks source link

Mysql storage #30

Closed twocs closed 1 month ago

twocs commented 1 month ago

https://github.com/plutov/formulosity/issues/29

For a hacktoberfest contribution, I have implemented mysql storage. It was a bit tricky to work past mysql limitations, but now all the tests are passing. This pull request introduces support for MySQL alongside existing support for PostgreSQL and SQLite. The changes span configuration updates, new database migrations, and modifications to the service initialization logic.

Database Support Expansion:

MySQL Migrations:

Service Initialization:

Docker Configuration:

Some known issues:

  1. The docker-compose file is getting a bit messy now. End users are expected to fill in their data, and comment out various lines corresponding to databases they don't use. It might be nice to have multiple sample docker-compose files, one for each database service type.
  2. Mysql does not appear to support multiStatement migrations (multiple DDL in a single file). The workaround I have seen (and used here) is to have a single statement per file, so there are six schema.up.sql files rather than a single one.
vercel[bot] commented 1 month ago

Someone is attempting to deploy a commit to the formulosity Team on Vercel.

A member of the Team first needs to authorize it.

plutov commented 1 month ago

Thanks for working on this @twocs However I already replied in he ticket that we don't need it.

twocs commented 1 month ago

I guess we don't need formality either, because it doesn't support our database.