Esempio n. 1
0
    def process(self, instrucction):
        typeChecker = TypeChecker()
        database = typeChecker.searchDatabase(self._database_name)

        if self._if_exists and not database:
            return

        typeChecker.deleteDatabase(self._database_name, self._noLine,
                                   self._noColumn)
Esempio n. 2
0
    def process(self, instrucction):
        typeChecker = TypeChecker()
        database = typeChecker.searchDatabase(self._dbActual)

        if not database:
            desc = f": Database {self._dbActual} does not exist"
            ErrorController().add(35, 'Execution', desc,
                                  self._noLine, self._noColumn)
            return

        SymbolTable().useDatabase = database
        DataWindow().consoleText('Query returned successfully: USE DATABASE')
Esempio n. 3
0
    def process(self, instrucction):
        typeChecker = TypeChecker()
        database = typeChecker.searchDatabase(self._properties['id'])

        if database:
            if self._properties['if_not_exists']:
                return

            if self._replace:
                typeChecker.deleteDatabase(database.name, self._noLine,
                                           self._noColumn)

        # TODO Verificar permisos y modo
        database = Database(self._properties['id'])

        for permits in self._properties['listpermits']:
            if 'MODE' in permits:
                database.mode = permits['MODE']

        typeChecker.createDatabase(database, self._noLine,
                                   self._noColumn)