コード例 #1
0
def extractRow(database, table, columns):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            # avlList.append(tableNew)
            return avl.extractRow(database, table, columns)
        elif currentMode == 'b':
            # bList.append(tableNew)
            return b.extractRow(database, table, columns)
        elif currentMode == 'bplus':
            # bplusList.append(tableNew)
            return bplus.extractRow(database, table, columns)
        elif currentMode == 'dict':
            # dictList.append(tableNew)
            return DM.extractRow(database, table, columns)
        elif currentMode == 'isam':
            # isamList.append(tableNew)
            return isam.extractRow(database, table, columns)
        elif currentMode == 'json':
            # jsonList.append(tableNew)
            return j.extractRow(database, table, columns)
        elif currentMode == 'hash':
            # hashList.append(tableNew)
            return Hash.extractRow(database, table, columns)
    else:
        return 2
コード例 #2
0
def loadCSV(file, database, table):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            # avlList.append(tableNew)
            return avl.loadCSV(file, database, table)
        elif currentMode == 'b':
            # bList.append(tableNew)
            return b.loadCSV(file, database, table)
        elif currentMode == 'bplus':
            # bplusList.append(tableNew)
            return bplus.loadCSV(file, database, table)
        elif currentMode == 'dict':
            # dictList.append(tableNew)
            return DM.loadCSV(file, database, table)
        elif currentMode == 'isam':
            # isamList.append(tableNew)
            return isam.loadCSV(file, database, table)
        elif currentMode == 'json':
            # jsonList.append(tableNew)
            return j.loadCSV(file, database, table)
        elif currentMode == 'hash':
            # hashList.append(tableNew)
            return Hash.loadCSV(file, database, table)
    else:
        return 2
コード例 #3
0
def alterDropColumn(database, table, columnNumber):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            # avlList.append(tableNew)
            return avl.alterDropColumn(database, table, columnNumber)
        elif currentMode == 'b':
            # bList.append(tableNew)
            return b.alterDropColumn(database, table, columnNumber)
        elif currentMode == 'bplus':
            # bplusList.append(tableNew)
            return bplus.alterDropColumn(database, table, columnNumber)
        elif currentMode == 'dict':
            # dictList.append(tableNew)
            return DM.alterDropColumn(database, table, columnNumber)
        elif currentMode == 'isam':
            # isamList.append(tableNew)
            return isam.alterDropColumn(database, table, columnNumber)
        elif currentMode == 'json':
            # jsonList.append(tableNew)
            return j.alterDropColumn(database, table, columnNumber)
        elif currentMode == 'hash':
            # hashList.append(tableNew)
            return Hash.alterDropColumn(database, table, columnNumber)
    else:
        return 2
コード例 #4
0
def insert(database, table, register):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            # avlList.append(tableNew)
            return avl.insert(database, table, register)
        elif currentMode == 'b':
            # bList.append(tableNew)
            return b.insert(database, table, register)
        elif currentMode == 'bplus':
            # bplusList.append(tableNew)
            return bplus.insert(database, table, register)
        elif currentMode == 'dict':
            # dictList.append(tableNew)
            return DM.insert(database, table, register)
        elif currentMode == 'isam':
            # isamList.append(tableNew)
            return isam.insert(database, table, register)
        elif currentMode == 'json':
            # jsonList.append(tableNew)
            return j.insert(database, table, register)
        elif currentMode == 'hash':
            # hashList.append(tableNew)
            return Hash.insert(database, table, register)
    else:
        return 2
コード例 #5
0
def showTables(database):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            # avlList.append(tableNew)
            return avl.showTables(database)
        elif currentMode == 'b':
            # bList.append(tableNew)
            return b.showTables(database)
        elif currentMode == 'bplus':
            # bplusList.append(tableNew)
            return bplus.showTables(database)
        elif currentMode == 'dict':
            # dictList.append(tableNew)
            return DM.showTables(database)
        elif currentMode == 'isam':
            # isamList.append(database)
            return isam.showTables(database)
        elif currentMode == 'json':
            # jsonList.append(database)
            return j.showTables(database)
        elif currentMode == 'hash':
            # hashList.append(database)
            return Hash.showTables(database)
    else:
        return 2
コード例 #6
0
def alterTable(database, tableOld, tableNew):
    if searchInMode(tableOld) != None:
        currentMode = searchInMode(tableOld)
        if currentMode == 'avl':
            avlList.append(tableNew)
            return avl.alterTable(database, tableOld, tableNew)
        elif currentMode == 'b':
            bList.append(tableNew)
            return b.alterTable(database, tableOld, tableNew)
        elif currentMode == 'bplus':
            bplusList.append(tableNew)
            return bplus.alterTable(database, tableOld, tableNew)
        elif currentMode == 'dict':
            dictList.append(tableNew)
            return DM.alterTable(database, tableOld, tableNew)
        elif currentMode == 'isam':
            isamList.append(tableNew)
            return isam.alterTable(database, tableOld, tableNew)
        elif currentMode == 'json':
            jsonList.append(tableNew)
            return j.alterTable(database, tableOld, tableNew)
        elif currentMode == 'hash':
            hashList.append(tableNew)
            return Hash.alterTable(database, tableOld, tableNew)
    else:
        return 2
コード例 #7
0
def createTable(database, table, numbercolumns):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            avlList.append(table)
            return avl.createTable(database, table, numbercolumns)
        elif currentMode == 'b':
            bList.append(table)
            return b.createTable(database, table, numbercolumns)
        elif currentMode == 'bplus':
            bplusList.append(table)
            return bplus.createTable(database, table, numbercolumns)
        elif currentMode == 'dict':
            dictList.append(table)
            return DM.createTable(database, table, numbercolumns)
        elif currentMode == 'isam':
            isamList.append(table)
            return isam.createTable(database, table, numbercolumns)
        elif currentMode == 'json':
            jsonList.append(table)
            return j.createTable(database, table, numbercolumns)
        elif currentMode == 'hash':
            hashList.append(table)
            return Hash.createTable(database, table, numbercolumns)
    else:
        return 2
コード例 #8
0
def chooseMode(mode, database):
    if mode == 'avl':
        if avl.createDatabase(database) == 0:
            avlList.append(database)
            return 0
        else:
            return avl.createDatabase(database)
    elif mode == 'b':
        if b.createDatabase(database) == 0:
            bList.append(database)
            return 0
        else:
            return b.createDatabase(database)
    elif mode == 'bplus':
        if bplus.createDatabase(database) == 0:
            bplusList.append(database)
            return 0
        else:
            return bplus.createDatabase(database)
    elif mode == 'dict':
        if DM.createDatabase(database) == 0:
            dictList.append(database)
            return 0
        else:
            return DM.createDatabase(database)
    elif mode == 'isam':
        if isam.createDatabase(database) == 0:
            isamList.append(database)
            return 0
        else:
            return isam.createDatabase(database)
    elif mode == 'json':
        if j.createDatabase(database) == 0:
            jsonList.append(database)
            return 0
        else:
            return j.createDatabase(database)
    elif mode == 'hash':
        if Hash.createDatabase(database) == 0:
            hashList.append(database)
            return 0
        else:
            return Hash.createDatabase(database)
コード例 #9
0
def showDatabases():
    showAvl = avl.showDatabases()
    showB = b.showDatabases()
    showBP = bplus.showDatabases()
    showDict = DM.showDatabases()
    showIsam = isam.showDatabases()
    showHash = Hash.showDatabases()
    showJson = j.showDatabases()
    showALL = 'avl = ' + str(showAvl) + '\n' + 'b = ' + str(
        showB) + '\n' + 'bplus = ' + str(showBP) + '\n' + 'dict = ' + str(
            showDict) + '\n' + 'isam = ' + str(
                showIsam) + '\n' + 'json = ' + str(
                    showJson) + '\n' + 'hash = ' + str(showHash)

    return showALL
コード例 #10
0
def dropDatabase(database):
    if searchInMode(database) != None:
        currentMode = searchInMode(database)
        if currentMode == 'avl':
            return avl.dropDatabase(database)
        elif currentMode == 'b':
            return b.dropDatabase(database)
        elif currentMode == 'bplus':
            return bplus.dropDatabase(database)
        elif currentMode == 'dict':
            return DM.dropDatabase(database)
        elif currentMode == 'isam':
            return isam.dropDatabase(database)
        elif currentMode == 'json':
            return j.dropDatabase(database)
        elif currentMode == 'hash':
            return Hash.dropDatabase(database)
    else:
        return 2