Beispiel #1
0
def main():
    """
    Main function to read records from the database to Find Top Manager with Highest Revenue in a Month

    :return: Nothing
    :rtype: None
    """

    # Getting the path for logging config using arparse
    log_config_file = helper.ARGUMENTS.logfile

    # Configuring logging
    helper.configure_logging(log_config_file)

    # Getting a new engine
    engine = connections.create_new_engine(helper.ARGUMENTS.dialect,
                                           helper.ARGUMENTS.driver,
                                           helper.ARGUMENTS.user,
                                           helper.ARGUMENTS.password,
                                           helper.ARGUMENTS.host,
                                           helper.ARGUMENTS.database)

    # Getting a session factory binded to previously created engine
    session_factory = connections.get_session_factory(engine)
    session = session_factory()

    db_aggregate.get_top_manager_revenue(session, helper.ARGUMENTS.number)
def main():
    """
    Main function to read records from the database to Get Tracks with More than One Genre

    :return: Nothing
    :rtype: None
    """

    # Getting the path for logging config using arparse
    log_config_file = helper.ARGUMENTS.logfile

    # Configuring logging
    helper.configure_logging(log_config_file)
    # Getting a new engine
    engine = connections.create_new_engine(helper.ARGUMENTS.dialect,
                                           helper.ARGUMENTS.driver,
                                           helper.ARGUMENTS.user,
                                           helper.ARGUMENTS.password,
                                           helper.ARGUMENTS.host,
                                           helper.ARGUMENTS.database)

    # Getting a session factory binded to previously created engine
    session_factory = connections.get_session_factory(engine)
    session = session_factory()

    db_aggregate.get_tracks_with_more_genre(session, helper.ARGUMENTS.number)
Beispiel #3
0
def main():
    """
    Main function to read records from the database using join operations

    :return: Nothing
    :rtype: None
    """

    # Getting the path for logging config using arparse
    log_config_file = helper.ARGUMENTS.logfile

    # Configuring logging
    helper.configure_logging(log_config_file)

    engine = connections.create_new_engine(helper.ARGUMENTS.dialect,
                                           helper.ARGUMENTS.driver,
                                           helper.ARGUMENTS.user,
                                           helper.ARGUMENTS.password,
                                           helper.ARGUMENTS.host,
                                           helper.ARGUMENTS.database)

    session_factory = connections.get_session_factory(engine)
    session = session_factory()

    db_read.perform_read_join(session, helper.ARGUMENTS.number)
def main():
    """
    Main function to to add Genre Tags to Artist

    :return: Nothing
    :rtype: None
    """

    # Getting the path for logging config using arparse
    log_config_file = helper.ARGUMENTS.logfile

    # Configuring logging
    helper.configure_logging(log_config_file)

    # Getting a new engine
    engine = connections.create_new_engine(helper.ARGUMENTS.dialect, helper.ARGUMENTS.driver,
                                           helper.ARGUMENTS.user, helper.ARGUMENTS.password,
                                           helper.ARGUMENTS.host, helper.ARGUMENTS.database)

    db_aggregate.add_genre_to_artist(engine, helper.ARGUMENTS.number)
def main():
    """
    Main function to perform the create operation

    :return: Nothing
    :rtype: None
    """

    # Getting the path for logging config using arparse
    log_config_file = helper.ARGUMENTS.logfile

    # Configuring logging
    helper.configure_logging(log_config_file)

    engine = connections.create_new_engine(helper.ARGUMENTS.dialect,
                                           helper.ARGUMENTS.driver,
                                           helper.ARGUMENTS.user,
                                           helper.ARGUMENTS.password,
                                           helper.ARGUMENTS.host,
                                           helper.ARGUMENTS.database)

    session_factory = connections.get_session_factory(engine)

    db_create.perform_create(session_factory)