martialblog / docker-limesurvey

A Docker Image for LimeSurvey
https://hub.docker.com/r/martialblog/limesurvey/
MIT License
154 stars 69 forks source link

Microsoft SQL Server support #148

Closed kpko closed 1 year ago

kpko commented 1 year ago

Hi!

I wanted to use LimeSurvey in docker container for one of my clients but had the problem that I didn't find any image, that supported MSSQL. As the other 'big' docker image at https://github.com/adamzammit/limesurvey-docker hardcodes some mysql commands into the entrypoint, I chose your project to try to adapt it to support MSSQL.

Basically I had to modify the Dockerfile to include freetds-dev/bin, install the pdo_dblib php extension and then enabled some options for the db type 'dblib'. After some initial problems (lime survey was not creating the database schema), I got it working now. I'm currently debugging the schema creation problem.

Would you be interested in a pull request to implement mssql support after I've done some cleanup and testing? Or is this something that you would like to keep out of this project?

I'm currently experimenting at https://github.com/kpko/docker-limesurvey/blob/feature/mssql:

Thank you!

kpko commented 1 year ago

Now my implementation also works with pdo_sqlsrv instead of pdo_dblib, this way the schema generation error is gone too (somehow transactions did not work via pdo_dblib, so the transaction in create-database.php never got committed to the database). This is the newer library for MSSQL connections, I would remove the support for dblib and clean up my code to prepare a pull request if somebody else needs the functionality.

martialblog commented 1 year ago

Hi, I will have a look at it and get back to you.

martialblog commented 1 year ago

Hey, been thinking about it. While it's an interesting feature, I won't be able to support/debug it in the longterm. So I rather not include it in the main code base.

But thanks for the hint and I might add some references for users that are interested.