def extractTable(database: str, table: str) -> list: try: b.dicDB[database][table][0] = serializar.rollback(database + "-" + table + "-B") except: pass return b.extractTable(database, table)
def extractRangeTable(database: str, table: str, columnNumber: int, lower: any, upper: any) -> list: try: b.dicDB[database][table][0] = serializar.rollback(database + "-" + table + "-B") except: pass return b.extractRangeTable(database, table, columnNumber, lower, upper)
def alterAddColumn(database: str, table: str, default: any) -> int: try: b.dicDB[database][table][0] = serializar.rollback(database+"-"+table+"-B") except: pass r = b.alterAddColumn(database, table, default) try: b.dicDB[database][table][0] = bt.arbolB(b.grade) serializar.commit(b, "BDD") except: pass return r
def alterDropPK(database: str, table: str) -> int: try: b.dicDB[database][table][0] = serializar.rollback(database+"-"+table+"-B") except: pass r = b.alterDropPK(database, table) try: b.dicDB[database][table][0] = bt.arbolB(b.grade) serializar.commit(b, "BDD") except: pass return r
def delete(database: str, table: str, columns: list) -> int: try: b.dicDB[database][table][0] = serializar.rollback(database+"-"+table+"-B") except: pass r = b.delete(database, table, columns) try: serializar.commit(b.dicDB[database][table][0], database+"-"+table+"-B") b.dicDB[database][table][0] = bt.arbolB(b.grade) serializar.commit(b, "BDD") except: pass return r
def loadCSV(file: str, database: str, table: str) -> list: try: b.dicDB[database][table][0] = serializar.rollback(database+"-"+table+"-B") except: pass r = b.loadCSV(file, database, table) try: serializar.commit(b.dicDB[database][table][0], database+"-"+table+"-B") b.dicDB[database][table][0] = bt.arbolB(b.grade) serializar.commit(b, "BDD") except: pass return r
def insert(database: str, table: str, register: list) -> int: try: b.dicDB[database][table][0] = serializar.rollback(database+"-"+table+"-B") except: pass r = b.insert(database, table, register) try: serializar.commit(b.dicDB[database][table][0], database+"-"+table+"-B") b.dicDB[database][table][0] = bt.arbolB(b.grade) serializar.commit(b, "BDD") except: pass return r
# File: B Mode Package # License: Released under MIT License # Notice: Copyright (c) 2020 TytusDB Team from team17 import DataBase as db from team17 import Serializable as serializar from team17 import Interfaz as interfaz from team17 import Estructura_ArbolB as bt b = db.DB() try: b = serializar.rollback("BDD") except: serializar.commit(b, "BDD") #---------------------FUNCIONES BASES DE DATOS----------------------# def createDatabase(database: str) -> int: r = b.createDatabase(database) serializar.commit(b, "BDD") return r def showDatabases() -> list: return b.showDatabases() def alterDatabase(databaseOld, databaseNew) -> int: r = b.alterDatabase(databaseOld, databaseNew) serializar.commit(b, "BDD") return r