| 604 | self.connect(dsn=dsn, **kwargs) |
| 605 | |
| 606 | def connect_service(self, service, user): |
| 607 | service_config, file = parse_service_info(service) |
| 608 | if service_config is None: |
| 609 | click.secho(f"service '{service}' was not found in {file}", err=True, fg="red") |
| 610 | sys.exit(1) |
| 611 | self.connect( |
| 612 | database=service_config.get("dbname"), |
| 613 | host=service_config.get("host"), |
| 614 | user=user or service_config.get("user"), |
| 615 | port=service_config.get("port"), |
| 616 | passwd=service_config.get("password"), |
| 617 | ) |
| 618 | |
| 619 | def connect_uri(self, uri): |
| 620 | kwargs = conninfo_to_dict(uri) |