Updated the code to add sql usage to the project.
Moved the old main here as a stash for the time being.