extract config to sql