# Path: regenesis/core.py
# def get_catalog(catalog_name):
# 
# Path: regenesis/database.py
# def get_fact_table(cube_name):
# def load_cube(cube, update=False):
# 
# Path: regenesis/database.py
# def get_fact_table(cube_name):
# def load_cube(cube, update=False):


from sqlalchemy import func, select, and_
from sqlalchemy.sql.expression import bindparam
from regenesis.core import engine, app
from regenesis.database import cube_table, value_table, statistic_table
from regenesis.database import dimension_table, reference_table, get_fact_table
from pprint import pprint




def get_cube(cube_name):
    cubes = get_cubes(cube_name)
    assert len(cubes)==1, 'Multiple hits: ' + cube_name
    return cubes.pop()


def get_cubes(cube_name=None):

# Path: regenesis/core.py
# def get_catalog(catalog_name):
# 
# Path: regenesis/database.py
# def get_fact_table(cube_name):
# def load_cube(cube, update=False):
# 
# Path: regenesis/database.py
# def get_fact_table(cube_name):
# def load_cube(cube, update=False):


# Path: regenesis/queries.py
from sqlalchemy import func, select, and_
from sqlalchemy.sql.expression import bindparam
from regenesis.core import engine, app
from regenesis.database import cube_table, value_table, statistic_table
from regenesis.database import dimension_table, reference_table, get_fact_table
from pprint import pprint





def get_cube(cube_name):
    cubes = get_cubes(cube_name)
    assert len(cubes)==1, 'Multiple hits: ' + cube_name
    return cubes.pop()


def get_cubes(cube_name=None):

    ct = cube_table.table.alias('cube')