Uses the logic from the sqltools VSCode add-on, with a workaround
for the use of 'type' in some table columns.
By detecting the presence of 'BUILD_WORKSPACE_DIRECTORY' we can tell
if the rule is running in test mode or was run directly, avoiding the
need for separate check and fix rules. It might be nice to extend this
to other formatting rules in the future as well.