sql writer api improvements