add category support, expand sql script