MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / load_servers

Method load_servers

web/setup.py:107–132  ·  view source on GitHub ↗

Load server groups and servers.

(input_file: str, user: Optional[str] = None,
                     auth_source: Optional[str] = INTERNAL,
                     sqlite_path: Optional[str] = None,
                     replace: Optional[bool] = False
                     )

Source from the content-addressed store, hash-verified

105 @app.command()
106 @update_sqlite_path
107 def load_servers(input_file: str, user: Optional[str] = None,
108 auth_source: Optional[str] = INTERNAL,
109 sqlite_path: Optional[str] = None,
110 replace: Optional[bool] = False
111 ):
112
113 """Load server groups and servers."""
114
115 # What user?
116 load_user = user if user is not None else config.DESKTOP_USER
117
118 print('----------')
119 print('Loading servers with:')
120 print('User:', load_user)
121 print('SQLite pgAdmin config:', config.SQLITE_PATH)
122 print('----------')
123
124 try:
125 app = create_app(config.APP_NAME + '-cli')
126 with app.test_request_context():
127 if replace:
128 clear_database_servers(load_user, True, auth_source)
129 load_database_servers(input_file, None, load_user, True,
130 auth_source)
131 except Exception as e:
132 print(str(e))
133
134
135class AuthExtTypes(str, Enum):

Callers

nothing calls this directly

Calls 3

create_appFunction · 0.90
clear_database_serversFunction · 0.90
load_database_serversFunction · 0.90

Tested by

no test coverage detected