Exemple #1
0
 def store_main_model_in_db(model, scaler_X, scaler_y):
     database = Database()
     database.create_table(CREATE_MODEL_QUERY)
     database.drop_table(DELETE_ALL_MODELS_QUERY)
     pickled_tuple = ModelStorage.__get_tuple_pickled(
         (model, scaler_X, scaler_y))
     database.insert_data(INSERT_MODEL_QUERY, pickled_tuple)
     database.close_connection()
 def _create_table(query: str):
     database = Database()
     database.create_table(query)
     database.close_connection()
Exemple #3
0
 def count_advise_items():
     database = Database()
     database.create_table(CREATE_ADVICE_TABLE_QUERY)
     counter = database.fetch_all_data(GET_ITEMS_COUNTER_QUERY)[0][0]
     database.close_connection()
     return counter
Exemple #4
0
 def count_sell_items():
     database = Database()
     database.create_table(CREATE_SELL_DATA_QUERY)
     counter = database.fetch_all_data(GET_SELLS_COUNT_QUERY)[0][0]
     database.close_connection()
     return counter