Ejemplo n.º 1
0
    def rename(self, new_name, database=None):
        """
        Rename table inside OmniSciDB. References to the old table are no
        longer valid.

        Parameters
        ----------
        new_name : string
        database : string

        Returns
        -------
        renamed : OmniSciDBTable
        """
        m = ddl.fully_qualified_re.match(new_name)
        if not m and database is None:
            database = self._database

        statement = ddl.RenameTable(self._qualified_name,
                                    new_name,
                                    new_database=database)

        self._client._execute(statement)

        op = self.op().change_name(statement.new_qualified_name)
        return type(self)(op)
Ejemplo n.º 2
0
    def rename(self, new_name, database=None):
        """
        Rename table to a given name.

        Parameters
        ----------
        new_name : string
        database : string

        Returns
        -------
        renamed : OmniSciDBTable
        """
        statement = ddl.RenameTable(self._qualified_name, new_name)

        self._client._execute(statement)

        op = self.op().change_name(statement.new_qualified_name)
        return type(self)(op)