Обсуждение: Import/export servers
A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.
--
Here's a draft patch to allow that, including docs and a basic test.
Review feedback please?
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения
small feedback,
In the tests, instead of self.assertTrue(a == b) use self.assertEqual(a == b) which will give more info if test case fails.
On Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:
A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Regards,
Navnath Gadakh
ignore previous, use self.assertEqual(a,b) instead of self.assertTrue(a == b)
On Tue, Nov 20, 2018 at 10:46 AM navnath gadakh <navnath.gadakh@enterprisedb.com> wrote:
small feedback,In the tests, instead of self.assertTrue(a == b) use self.assertEqual(a == b) which will give more info if test case fails.On Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Regards,Navnath Gadakh
Regards,
Navnath Gadakh
Hi Dave
--
![](http://www.enterprisedb.com/sites/default/files/EDB-logo-4c.png)
On Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:
A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?
Patch looks good to me. Can we have option to provide the servers to be exported? It may possible that user don't want to export the local servers as it is automatically detected. Can we have GUI(may be dialog) for this?
--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Akshay Joshi
Sr. Software Architect
![](http://www.enterprisedb.com/sites/default/files/EDB-logo-4c.png)
Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Done - thanks!
On Tue, Nov 20, 2018 at 5:34 AM navnath gadakh <navnath.gadakh@enterprisedb.com> wrote:
ignore previous, use self.assertEqual(a,b) instead of self.assertTrue(a == b)On Tue, Nov 20, 2018 at 10:46 AM navnath gadakh <navnath.gadakh@enterprisedb.com> wrote:small feedback,In the tests, instead of self.assertTrue(a == b) use self.assertEqual(a == b) which will give more info if test case fails.On Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?--Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company--Regards,Navnath Gadakh--Regards,Navnath Gadakh
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Hi
--
On Tue, Nov 20, 2018 at 6:01 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi DaveOn Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?Patch looks good to me. Can we have option to provide the servers to be exported? It may possible that user don't want to export the local servers as it is automatically detected. Can we have GUI(may be dialog) for this?
This is intentionally not a GUI feature.
I've added a --server flag to allow the user to specify specific servers (without it, all are dumped), and changed the JSON structure per the discussion we had earlier to ensure that servers with duplicate names can be dumped.
Please re-review.
Thanks!
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Вложения
Hi Dave
--
![](http://www.enterprisedb.com/sites/default/files/EDB-logo-4c.png)
On Tue, Nov 20, 2018 at 8:23 PM Dave Page <dpage@pgadmin.org> wrote:
HiOn Tue, Nov 20, 2018 at 6:01 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi DaveOn Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?Patch looks good to me. Can we have option to provide the servers to be exported? It may possible that user don't want to export the local servers as it is automatically detected. Can we have GUI(may be dialog) for this?This is intentionally not a GUI feature.I've added a --server flag to allow the user to specify specific servers (without it, all are dumped), and changed the JSON structure per the discussion we had earlier to ensure that servers with duplicate names can be dumped.
Following are the review comments:
- "--server" should be "--servers" as user can specify multiple servers to dump.
- Instead of specifying server names with --server, it should be server ids which is easy for user to type. As names can be a long strings.
- One more advantage of using server id over name is consider a case where two different servers having same name. With current implementation it will dump only one server.
--Please re-review.Thanks!Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Akshay Joshi
Sr. Software Architect
![](http://www.enterprisedb.com/sites/default/files/EDB-logo-4c.png)
Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
On Wed, Nov 21, 2018 at 9:27 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi DaveOn Tue, Nov 20, 2018 at 8:23 PM Dave Page <dpage@pgadmin.org> wrote:HiOn Tue, Nov 20, 2018 at 6:01 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi DaveOn Mon, Nov 19, 2018 at 8:09 PM Dave Page <dpage@pgadmin.org> wrote:A number of people have asked for the ability to import and export server definitions. It's also convenient to have such a feature in the container world, where new instances of pgAdmin containers may be created on the fly.Here's a draft patch to allow that, including docs and a basic test.Review feedback please?Patch looks good to me. Can we have option to provide the servers to be exported? It may possible that user don't want to export the local servers as it is automatically detected. Can we have GUI(may be dialog) for this?This is intentionally not a GUI feature.I've added a --server flag to allow the user to specify specific servers (without it, all are dumped), and changed the JSON structure per the discussion we had earlier to ensure that servers with duplicate names can be dumped.Following are the review comments:
- "--server" should be "--servers" as user can specify multiple servers to dump.
- Instead of specifying server names with --server, it should be server ids which is easy for user to type. As names can be a long strings.
- One more advantage of using server id over name is consider a case where two different servers having same name. With current implementation it will dump only one server.
Thanks - done and pushed.
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company