Add sql to layers