Move all SQL queries into single module #1534

Open
g1itch wants to merge 7 commits from g1itch/refactoring-sql into v0.6

7 Commits