update sql and lib