__init__.py 739 Bytes
Newer Older
1 2 3 4
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base

5
from common.configuration import zoeconf
6 7 8

Base = declarative_base()

9
_engine = create_engine(zoeconf.db_url, echo=False)
10 11 12 13
AlchemySession = sessionmaker(bind=_engine)

from common.state.container import Container
from common.state.cluster import Cluster
14
from common.state.application import Application, SparkApplication, SparkNotebookApplication, SparkSubmitApplication
15
from common.state.user import User
16 17
from common.state.proxy import Proxy
from common.state.execution import Execution, SparkSubmitExecution
18 19 20 21 22


def create_tables():
    Base.metadata.drop_all(_engine)
    Base.metadata.create_all(_engine)