moving SQL class into separate file

[skip ci]