#!/usr/bin/env python

# create the sourcy database (from the sqlalchemy definition in models.py)

from optparse import OptionParser
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker

from pprint import pprint
from unsourced.config import settings
from unsourced.models import Base

def main():

#    parser = OptionParser()
#    (opts, args) = parser.parse_args()
#    if len(args) != 2:
#        parser.error("requires 2 args: <kind> <infile>")

    eng_url = "mysql+mysqldb://%(user)s:%(password)s@%(host)s/%(db)s?charset=utf8" % {
        'user': settings.mysql_user,
        'password': settings.mysql_password,
        'host': settings.mysql_host,
        'db': settings.mysql_database
    }
    engine = create_engine(eng_url, echo=True)


    Base.metadata.create_all(engine)

    Session = sessionmaker(bind=engine)
    session = Session()


if __name__ == "__main__":
    main()

