Open joepavitt opened 3 months ago
Notes from PoC
lower(username)
and lower(email)
in table Users
we need an alternative approach.DESC NULLS LAST
is not supported. for MSSQL, DESC
is the same as DESC NULLS LAST
updateSettings
needed rewriting to perform this manuallyliteral
statements using TRUE
for boolean comparison need to use 1
insteadLOCK TABLE "MetaVersions" IN ACCESS EXCLUSIVE MODE
equivalent in MSSQL is SELECT * FROM "MetaVersions" WITH (TABLOCKX, HOLDLOCK)
The bulk of the remaining work in realising this POC (based on the above) will be in ensuring consistent DB operations. I recommend we do a thorough check of tests around the tables affected, ensuring they specifically check cascades operate as expected. Time est for this piece of work is size 5.
I will push the working POC branch and link it to the issue shortly
Status of POC - based on the branch and above notes:
Working POC Branch here: https://github.com/FlowFuse/flowfuse/tree/3689-mssql-support
UPDATE:
More work pushed to branch. Now 99% complete however there are some decisions and paths chosen that should be carefully considered and discussed with other engineers before the work is committed.
Definitely an 80:20 thing
Branch updates to fix missing awaits, add application logic for modified constraints and various other things, I have managed in local testing to get MSSQL tests down from 100+ failures to:
1363 passing (13m)
24 pending
5 failing
```
1363 passing (13m)
24 pending
5 failing
1) Project Type API
Update project type
Prevents duplicate project-type name:
AssertionError: expected Object {
code: 'unexpected_error',
error: 'UQ__ProjectT__72E12F1BE572B557 must be unique'
} to have property error of 'name must be unique' (got 'UQ__ProjectT__72E12F1BE572B557 must be unique')
at Assertion.fail (node_modules\should\cjs\should.js:275:17)
at Assertion.value [as property] (node_modules\should\cjs\should.js:356:19)
at Context.
Think I've seen in Slack, this is now done?
Think I've seen in Slack, this is now done?
No, it is at a point where we can state it is viable (with some more work to fix remaining tests) but it does require some engineering discussion and agreement on direction and overall acceptance (including ramifications on relationships & cascades changes in order to adopt MSSQL DB as a backend choice)
there was some feedback of nervousness supporting another DB which i do not fully disagree.
It was deliberately raised in slack first
@zackwasli what's your requirements/status on this now?
The potential customer has not shared the date where they need this by. It would be required for the project that they are undertaking for their client, but we are still in the proposal stages. The potential customer has decided on FlowFuse, but they need buy in from their client before signing a contract with us. I imagine this integration will be needed shortly after that once they begin their initial deployment. If I had to estimate, we have a month or so to go before implementation. But even then, this may not be needed on day 1 of the implementation.
Sorry for the vagueness, but this is everything that we know at this point and it is a work in progress. We have a technical call with them later this week and I will try to get more clarity.
Moving to backlog
Investigate the consequences and requirements for running MS SQL Server as the core DB in FlowFuse.
Initial thoughts on approach
The first task to enable MS SQL Server support will be to add the
tedious
driver to thepackage.json
of the forge application.Next, the mapping of properties from the YAML to the connection.
Any raw SQL queries will need to be assessed for compatibility.
Any conditional logic testing for SQLite or PG will need to have equivalent SQL Server logic