This PR fixes the bug when trying to extract from a MS SQL Server db, where trying to sort address history by date with nulls last doesn't work due to MS SQL not supporting NULLS LAST.
The idea here is to only add NULLS LAST to the query when needed, ie, on postgres and oracle. Fortunately on MS SQL it already sorts in the order we want by default, so we don't have to do anything else.
Note: I tested this myself on postgres and MSSQL, but not oracle as I'm having a rough time trying to get the script to run against the docker image I set up. Based on testing with pure SQL though, oracle does support NULLS LAST
I also left a TODO to test on MySQL, but we don't currently have any partners who use it so we can defer that to later
This PR fixes the bug when trying to extract from a MS SQL Server db, where trying to sort address history by date with nulls last doesn't work due to MS SQL not supporting
NULLS LAST
.The idea here is to only add
NULLS LAST
to the query when needed, ie, on postgres and oracle. Fortunately on MS SQL it already sorts in the order we want by default, so we don't have to do anything else.Note: I tested this myself on postgres and MSSQL, but not oracle as I'm having a rough time trying to get the script to run against the docker image I set up. Based on testing with pure SQL though, oracle does support
NULLS LAST
I also left a TODO to test on MySQL, but we don't currently have any partners who use it so we can defer that to later