Обсуждение: Regarding DDL in pgadmin

Поиск
Список
Период
Сортировка

Regarding DDL in pgadmin

От
Travis
Дата:
How does pdadmin4 get DDL of a table i cannot find any refrence in source code
kindly help

Re: Regarding DDL in pgadmin

От
Dave Page
Дата:
Hi

On Wed, Mar 20, 2019 at 7:15 AM Travis <himesh8chopra@gmail.com> wrote:
How does pdadmin4 get DDL of a table i cannot find any refrence in source code
kindly help

The hard way I'm afraid - it's reverse engineered and re-generated from the system catalogues.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: Regarding DDL in pgadmin

От
Dave Page
Дата:
[please keep messages on-list]

On Thu, Mar 21, 2019 at 10:16 AM Travis <himesh8chopra@gmail.com> wrote:

Thanks a lot!

yeah rev eng sucks.

I'm currently going through the source code, can you kindly point me to the module where the rev engineering is already being done.?


Most of the heavy lifting will be done in __init__.py in https://git.postgresql.org/gitweb/?p=pgadmin4.git;a=tree;f=web/pgadmin/browser/server_groups/servers/databases/schemas/tables. The re-construction of the SQL is done using templates in the templates sub-directory. Start at the sql(self, gid, sid, did, scid, tid) function and work back from there.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company