Customizing user names

I would like to setup Jupyterhub for wider audience using Social authentication and local users.

However, the user names are by default created using email ids or we can customize using simple rules as part of normalize_username.

Now my question is if I want to assign names like student001, student002, etc what is the right way of implementing it?

I have made some progress by using SQLAlchemy, but it will end up establishing a database connection for each operation. Is there a way, I can get the existing sessions from session factory and use them as part of jupyterhub_config.py?