mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Allow user to change the database connection from an open query tool tab. Fixes #3794
This commit is contained in:
committed by
Akshay Joshi
parent
228d4bb321
commit
be7bb81a19
@@ -95,6 +95,15 @@ class ServerGroup(db.Model):
|
||||
name = db.Column(db.String(128), nullable=False)
|
||||
__table_args__ = (db.UniqueConstraint('user_id', 'name'),)
|
||||
|
||||
@property
|
||||
def serialize(self):
|
||||
"""Return object data in easily serializable format"""
|
||||
return {
|
||||
'id': self.id,
|
||||
'user_id': self.user_id,
|
||||
'name': self.name,
|
||||
}
|
||||
|
||||
|
||||
class Server(db.Model):
|
||||
"""Define a registered Postgres server"""
|
||||
@@ -176,6 +185,44 @@ class Server(db.Model):
|
||||
tunnel_password = db.Column(db.String(64), nullable=True)
|
||||
shared = db.Column(db.Boolean(), nullable=False)
|
||||
|
||||
@property
|
||||
def serialize(self):
|
||||
"""Return object data in easily serializable format"""
|
||||
return {
|
||||
"id": self.id,
|
||||
"user_id": self.user_id,
|
||||
"servergroup_id": self.servergroup_id,
|
||||
"name": self.name,
|
||||
"host": self.host,
|
||||
"hostaddr": self.hostaddr,
|
||||
"port": self.port,
|
||||
"maintenance_db": self.maintenance_db,
|
||||
"username": self.username,
|
||||
"password": self.password,
|
||||
"save_password": self.save_password,
|
||||
"role": self.role,
|
||||
"ssl_mode": self.ssl_mode,
|
||||
"comment": self.comment,
|
||||
"discovery_id": self.discovery_id,
|
||||
"db_res": self.db_res,
|
||||
"passfile": self.passfile,
|
||||
"sslcert": self.sslcert,
|
||||
"sslkey": self.sslkey,
|
||||
"sslrootcert": self.sslrootcert,
|
||||
"sslcrl": self.sslcrl,
|
||||
"sslcompression": self.sslcompression,
|
||||
"bgcolor": self.bgcolor,
|
||||
"fgcolor": self.fgcolor,
|
||||
"service": self.service,
|
||||
"connect_timeout": self.connect_timeout,
|
||||
"use_ssh_tunnel": self.use_ssh_tunnel,
|
||||
"tunnel_host": self.tunnel_host,
|
||||
"tunnel_port": self.tunnel_port,
|
||||
"tunnel_authentication": self.tunnel_authentication,
|
||||
"tunnel_identity_file": self.tunnel_identity_file,
|
||||
"tunnel_password": self.tunnel_password
|
||||
}
|
||||
|
||||
|
||||
class ModulePreference(db.Model):
|
||||
"""Define a preferences table for any modules."""
|
||||
|
||||
Reference in New Issue
Block a user