The only reason you'd need to keep the separate layer is if you have to index the tables differently depending on backend.
Indexes may be part of the db-specific part (or at least specific indexes if needed, TBH I have no idea what are the current differences between the three), but that could make sense, tough repeat tables and inserts in all the three seems a bit inefficient...
Ohhh.... so long ago!
Well, I'm now messing a lot with both install and upgrade.
Install is already fine, I moved first to a single ".sql" file, then I recently rewrote it to use a class instead, so a single php file. Much cleaner.
Upgrade is a little behind because it a bit more messy, though it's catching up: it's not a single file for any dbms, and I'm in the process of converting it to a class as well.
I've also started a general splitting of the install.php and upgrade.php files, in order to better understand what's going on in there and start a kind of refactoring. It's still an early WIP, but it should give some results at some point in the future. lol
Back working on upgrade now!
For the reference, this is the code I'm working on:
https://github.com/elkarte/Elkarte/pull/2051
wOOt :D ... thats awesome! Its fun to look way back and see what those files looked like a couple of years ago, they have come a long way.
Indeed, indeed! :D
Now support other database systems will be a slightly smaller pain! :P
The only tiny thing I'm not entirely happy about is that I'm not sure it's possible to pause the sub-steps, but honestly I'm not entirely sure it was possible with the old code as well, so I didn't pay much attention either. lol
There is also a kind of pending piece, but again I'm not sure how worth it is: in the old code, ALTER TABLEs had several checks to wait until the alteration was finished. I feel this was working reliably only when running with javascript available and on MySQL, for that reason I didn't spend much time trying to re-implement it, I just added few mock methods and some comments, but I left everything unfinished.
And just for tracking: actually, the main reason I found in the code for having additional dbms-specific files in the install/upgrade process was for postgre to add the custom functions at the beginning, so I gave the possibility to have one additional file at the beginning of the process. If more are needed in the future tweak that part would be easy. :D