summaryrefslogtreecommitdiff
path: root/ausbutler/db.py
blob: 15f35189905215020a781e07c6a09b4f9763a92e (plain)
1
2
3
4
5
6
7
8
9
10
11
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from .config import load_config

def get_session():
    session = sessionmaker(bind=create_engine(
        "mysql://{0[user]}:{0[pass]}@{0[host]}/{0[db]}?charset=utf8".format(
            load_config('db')
        )))
    return session()