Executes a USE... query
(self, args)
| 1652 | return self._execute_stmt(query, print_web_link=True) |
| 1653 | |
| 1654 | def do_use(self, args): |
| 1655 | """Executes a USE... query""" |
| 1656 | cmd_status = self._execute_stmt( |
| 1657 | self._build_query_string(self.last_leading_comment, self.orig_cmd, args)) |
| 1658 | if cmd_status is CmdStatus.SUCCESS: |
| 1659 | self.current_db = args.strip('`').strip() |
| 1660 | self.set_prompt(self.current_db) |
| 1661 | elif args.strip('`') == self.current_db: |
| 1662 | # args == current_db means -d option was passed but the "use [db]" operation failed. |
| 1663 | # We need to set the current_db to None so that it does not show a database, which |
| 1664 | # may not exist. |
| 1665 | self.current_db = None |
| 1666 | return CmdStatus.ERROR |
| 1667 | else: |
| 1668 | return CmdStatus.ERROR |
| 1669 | |
| 1670 | def do_show(self, args): |
| 1671 | """Executes a SHOW... query, fetching all rows""" |
nothing calls this directly
no test coverage detected