Ensure the newly added parameters in the server dialog are incorporated into the Import/Export Servers functionality. #8514

pull/8553/head
Akshay Joshi 2025-03-20 15:49:43 +05:30
parent 47eca9a19c
commit fc1a1610a3
3 changed files with 45 additions and 16 deletions

View File

@ -148,41 +148,50 @@ The following example shows both a minimally defined and a fully defined server:
"Port": 5432,
"Username": "postgres",
"Host": "localhost",
"SSLMode": "prefer",
"MaintenanceDB": "postgres"
"MaintenanceDB": "postgres",
"ConnectionParameters": {
"sslmode": "prefer",
"connect_timeout": 10
}
},
"2": {
"Name": "Fully Defined Server",
"Group": "Server Group 2",
"Host": "host.domain.com",
"HostAddr": "192.168.1.2",
"Port": 5432,
"MaintenanceDB": "postgres",
"Username": "postgres",
"Role": "my_role_name",
"SSLMode": "require",
"Comment": "This server has every option configured in the JSON",
"DBRestriction": "live_db test_db",
"PassFile": "/path/to/pgpassfile",
"SSLCert": "/path/to/sslcert.crt",
"SSLKey": "/path/to/sslcert.key",
"SSLRootCert": "/path/to/sslroot.crt",
"SSLCrl": "/path/to/sslcrl.crl",
"SSLCompression": 1,
"Shared": false,
"SharedUsername": "postgres",
"BGColor": "#ff9900",
"FGColor": "#000000",
"Service": "postgresql-10",
"Timeout": 60,
"UseSSHTunnel": 1,
"TunnelHost": "192.168.1.253",
"TunnelPort": 22,
"TunnelUsername": "username",
"TunnelAuthentication": 0,
"TunnelAuthentication": 1,
"TunnelIdentityFile": "/Users/<user>/.ssh/id_rsa.pub",
"TunnelKeepAlive": 30,
"PasswordExecCommand": "echo 'test'",
"PasswordExecExpiration": 100
"PasswordExecExpiration": 100,
"KerberosAuthentication": true,
"ConnectionParameters": {
"sslmode": "prefer",
"connect_timeout": 10,
"passfile": "/Users/<user>/.pgpass",
"sslcert": "/Users/<user>/.ssh/cert"
},
"Tags": [
{
"color": "#EC0BB4",
"text": "Development"
}
],
"PostConnectionSQL": "set timezone='America/New_York'"
}
}
}
}

View File

@ -40,4 +40,6 @@ Bug fixes
| `Issue #8437 <https://github.com/pgadmin-org/pgadmin4/issues/8437>`_ - Fixed an issue where the PSQL terminal displays keyname for non alphanumeric keys.
| `Issue #8462 <https://github.com/pgadmin-org/pgadmin4/issues/8462>`_ - Fixed an issue where geometries in the geometry viewer will render partially when the container was resized.
| `Issue #8473 <https://github.com/pgadmin-org/pgadmin4/issues/8473>`_ - Change the stop/terminate icon at all the places for better UX.
| `Issue #8479 <https://github.com/pgadmin-org/pgadmin4/issues/8479>`_ - Fixed an issue where the Schema Diff was not displaying the difference query when a table had a UNIQUE NULLS NOT DISTINCT constraint.
| `Issue #8479 <https://github.com/pgadmin-org/pgadmin4/issues/8479>`_ - Fixed an issue where the Schema Diff was not displaying the difference query when a table had a UNIQUE NULLS NOT DISTINCT constraint.
| `Issue #8514 <https://github.com/pgadmin-org/pgadmin4/issues/8514>`_ - Ensure the newly added parameters in the server dialog are incorporated into the Import/Export Servers functionality.
| `Issue #8546 <https://github.com/pgadmin-org/pgadmin4/issues/8546>`_ - Fixed an issue where updating the grantee was not correctly applying the privileges.

View File

@ -522,11 +522,19 @@ def dump_database_servers(output_file, selected_servers,
add_value(attr_dict, "TunnelUsername", server.tunnel_username)
add_value(attr_dict, "TunnelAuthentication",
server.tunnel_authentication)
add_value(attr_dict, "TunnelIdentityFile",
server.tunnel_identity_file)
add_value(attr_dict, "TunnelKeepAlive",
server.tunnel_keep_alive)
add_value(attr_dict, "KerberosAuthentication",
server.kerberos_conn),
add_value(attr_dict, "ConnectionParameters",
server.connection_params)
add_value(attr_dict, "Tags", server.tags)
add_value(attr_dict, "PrepareThreshold",
server.prepare_threshold)
add_value(attr_dict, "PostConnectionSQL",
server.post_connection_sql)
# if desktop mode or server mode with
# ENABLE_SERVER_PASS_EXEC_CMD flag is True
@ -759,6 +767,12 @@ def load_database_servers(input_file, selected_servers,
new_server.tunnel_authentication = \
obj.get("TunnelAuthentication", None)
new_server.tunnel_identity_file = \
obj.get("TunnelIdentityFile", None)
new_server.tunnel_keep_alive = \
obj.get("TunnelKeepAlive", None)
new_server.shared = obj.get("Shared", None)
new_server.shared_username = obj.get("SharedUsername", None)
@ -767,6 +781,10 @@ def load_database_servers(input_file, selected_servers,
new_server.tags = obj.get("Tags", None)
new_server.prepare_threshold = obj.get("PrepareThreshold", None)
new_server.post_connection_sql = obj.get("PostConnectionSQL", None)
# if desktop mode or server mode with
# ENABLE_SERVER_PASS_EXEC_CMD flag is True
if not current_app.config['SERVER_MODE'] or \