kndndrj / nvim-dbee

Interactive database client for neovim
GNU General Public License v3.0
606 stars 39 forks source link

[potential contribution] listing more than just tables in the drawer #99

Open willruggiano opened 2 months ago

willruggiano commented 2 months ago

In particular things like functions and procedures would be nice to have (ala pgadmin4). I have been working with procedures a lot recently and have a few notes containing very short "create ddl" scripts (basically select pg_catalog.pg_get_functiondef('proc name'::regproc); - it'd be nice to be able to on the procedure in the drawer, same as you do for tables, and be able to execute the "create ddl script" just like I have for tables.

Anyways, how might I go about adding support for this kind of thing? I haven't found anything to suggest this is possible out of the box right now, but I am open to adding this functionality since it will be a win for me personally :)

kndndrj commented 2 months ago

Hi @willruggiano you can start by looking into how the postgres driver in go is structured - notably the Structure method. Look at how the query is written and how the structure output is assembled from it.

Let me know if you need anything!