MCPcopy
hub / github.com/dbcli/pgcli / connect_service

Method connect_service

pgcli/main.py:606–617  ·  view source on GitHub ↗
(self, service, user)

Source from the content-addressed store, hash-verified

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)

Callers 2

cliFunction · 0.95
test_pg_service_fileFunction · 0.95

Calls 2

connectMethod · 0.95
parse_service_infoFunction · 0.85

Tested by 1

test_pg_service_fileFunction · 0.76