Add some SQL stuff and basic functionality