move sql to constants
use constatns settings
implement reader rotate
test rotate