import os
import logging

from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

DB_FILE = 'server.sqlite'
db_path = os.path.join(os.path.dirname(__file__), '..', '..', DB_FILE)
logging.debug('db path: {path}'.format(path=db_path))

engine = create_engine('sqlite:///{path}'.format(path=db_path), echo=False)

Base = declarative_base()
Session = sessionmaker(bind=engine)
