MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / get_restore_util_args

Function get_restore_util_args

web/pgadmin/tools/restore/__init__.py:283–374  ·  view source on GitHub ↗

return the args for the command :param data: Data. :param manager: Manager. :param server: Server. :param driver: Driver. :param conn: Connection. :param filepath: File. :return: args list.

(data, manager, server, driver, conn, filepath)

Source from the content-addressed store, hash-verified

281
282
283def get_restore_util_args(data, manager, server, driver, conn, filepath):
284 """
285 return the args for the command
286 :param data: Data.
287 :param manager: Manager.
288 :param server: Server.
289 :param driver: Driver.
290 :param conn: Connection.
291 :param filepath: File.
292 :return: args list.
293 """
294 args = []
295
296 if 'list' in data:
297 args.append('--list')
298 else:
299 host = manager.local_bind_host if manager.use_ssh_tunnel \
300 else server.host
301 port = manager.local_bind_port if manager.use_ssh_tunnel \
302 else server.port
303
304 if host:
305 args.extend(['--host', host])
306 if port:
307 args.extend(['--port', str(port)])
308 if server.username:
309 args.extend(['--username', server.username])
310
311 args.append('--no-password')
312
313 set_value('role', '--role', data, args)
314 set_value('database', '--dbname', data, args)
315
316 if data['format'] == 'directory':
317 args.extend(['--format=d'])
318 set_value('no_of_jobs', '--jobs', data, args)
319
320 # Sections
321 set_param('pre_data', '--section=pre-data', data, args)
322 set_param('data', '--section=data', data, args)
323 set_param('post_data', '--section=post-data', data, args)
324
325 # Do not Save
326 if not set_param('only_data', '--data-only', data, args):
327 set_param('dns_owner', '--no-owner', data, args)
328 set_param('dns_privilege', '--no-privileges', data, args)
329 set_param('dns_tablespace', '--no-tablespaces', data, args)
330 if manager.version >= 110000:
331 set_param('dns_comments', '--no-comments', data, args)
332 set_param('dns_publications', '--no-publications', data, args)
333 set_param('dns_subscriptions', '--no-subscriptions', data,
334 args)
335 set_param('dns_security_labels', '--no-security-labels', data,
336 args)
337 if manager.version >= 150000:
338 set_param('dns_table_access_method',
339 '--no-table-access-method', data, args)
340

Callers 1

use_restore_utilityFunction · 0.85

Calls 5

set_multipleFunction · 0.85
appendMethod · 0.80
extendMethod · 0.80
set_valueFunction · 0.70
set_paramFunction · 0.70

Tested by

no test coverage detected