The user manager has the method countUsers() to find out their number. But check first if sqlite is in fact in use. You get it via \OCP\Config::getSystemValue('dbtype'); and can strpos for sqlite.