from orm.postgres import Postgres
from orm import get_driver_name, ConnectionProtocol
from slinn import ProjectAPI
from email_tools import send_verify_code
import secrets
import string
import geety as G
import bcrypt
import getpass


gapp = G.App(context={
    'PNAME': ProjectAPI.get_config()['name']
})


for db in ProjectAPI.get_config()['dbs']:
    match get_driver_name(db['dsn']):
        case 'postgres':
            gapp.add_database_pool(Postgres(
                db['dsn'],
                server_settings=db['server_settings']
            ))

fobox_db = gapp.db_pools[0]

async def db_init(conn: ConnectionProtocol):
    # TODO: replace with crossbase implementation



    :



fobox_db.on_acquire(db_init)
