from sqlalchemy import create_engine


def db_connect():
    db_connect_string = "postgresql+psycopg2://{user}:{passwd}@{server}:{port}/{db}".format(
        user="foo", passwd="bar",
        server="server.example.com", db="baz", port="0000"
    )
    ssl_args = {
        "sslmode": "require",
        "sslcert": "/home/user/pgsql-client.crt",
        "sslkey": "/home/user/pgsql-client.key",
        "sslrootcert": "/home/user/root.crt",
    }
    return create_engine(db_connect_string, connect_args=ssl_args)
