public inbox for [email protected]  
help / color / mirror / Atom feed
From: Surinder Kumar <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: [pgAdmin4][Patch]: RM#1420 - Reverse engineered SQL incomplete for Databases
Date: Mon, 11 Jul 2016 15:28:43 +0530
Message-ID: <CAM5-9D_rdiiJ8S35S=kTT5e9w3i5Hg94CVZ1KhcmbnUskD12kw@mail.gmail.com> (raw)
List-Unsubscribe:  <mailto:[email protected]?body=unsub%20pgadmin-hackers>

Hi

Please find attached patch with fix and review.
Included missing Create and Drop comments in generated sql query.

Thanks,
Surinder Kumar


-- 
Sent via pgadmin-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers


Attachments:

  [application/octet-stream] RM#1420.patch (786B, 3-RM%231420.patch)
  download | inline diff:
diff --git a/web/pgadmin/browser/server_groups/servers/databases/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
index 1f7fd07..08b682d 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/__init__.py
+++ b/web/pgadmin/browser/server_groups/servers/databases/__init__.py
@@ -860,8 +860,16 @@ class DatabaseView(PGChildNodeView):
         frmtd_variables = parse_variables_from_db(res1['rows'])
         result.update(frmtd_variables)

+        sql_header = """
+-- Database: {0}
+
+-- DROP DATABASE {0};
+
+""".format(result['name'])
+
         SQL = self.get_new_sql(gid, sid, result, did)
         SQL = re.sub('\n{2,}', '\n\n', SQL)
+        SQL = sql_header + SQL
         SQL = SQL.strip('\n')
         return ajax_response(response=SQL)



view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [pgAdmin4][Patch]: RM#1420 - Reverse engineered SQL incomplete for Databases
  In-Reply-To: <CAM5-9D_rdiiJ8S35S=kTT5e9w3i5Hg94CVZ1KhcmbnUskD12kw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox