jakob/Postico

Add support for editing functions (stored procedures)

Closed this issue Β· 86 comments

jakob commented

Multiple users have requested a way to edit stored procedures/functions in Postico.

I'm not currently working on this feature, but I do plan to add it at some point in the future.

Please click the thumbs up button if this would be useful for you!

While it's definitely a feature I would like to have it also seems like a lot of work.
Sequences, indices, extensions and custom data types are probably easier to add.

Would be great

Definitely! I'm having trouble editing a function right now and would love to have the ability to view and edit it easily.

radim commented

+1

+1

Yes, please. You seem to have a vert nice tool, that only solves half of the problem.

+1 Great tool but to use it seriously, we need stored procedures.

Yes please, this is very important!

Very important! I love the application, but this would be the one thing holding me back from purchasing the full version. Premium feature?

Please do. Just purchased this and was surprised to find that editing functions wasn't already available.

What would it mean to have editing features for functions?
A minimal yet useful improvement would be, IMHO, to see functions listed in left tree, just like tables.

Once selected a function on tree, its details would be displayed with a tabbed interface similar to the one now available for tables:

  • the "structure" tab would become an SQL editor with the function create script in it,
  • the "content" tab could allow to execute function setting params via a dedicated UI component, and displaying results like in query editor.

What else?

Honestly, that would be all I need. The interface for functions in the competing product is overkill for me and really slows down my workflow.

Most of the time when editing a function, I just need minor changes which are quick and easy with a simple editor.

@trapias what you've described would be plenty for my needs -- I agree with @topherlandry. I think it's more about quick access/editing/execution than anything else -- nothing fancy.

I also think we could go with a minimal, efficient way to handle this.

Don't know how you do it, but I normally have pgAdmin open together with Postico: I use the former to find the function I need to work on, copy its content and paste it into Postico to work on it.

Just having the possibility to see functions and click on them to get them pasted in query editor would be a time-saver.
I'd say we could slightly change the navigation sidebar, just:

  • put all tables under a "tables" node in tree
  • add a new "functions" node, and list functions under it
  • click on a function to open it in query editor
  • optionally right-click for a context menu with actions like "drop", "create new", "edit"
  • let the filter ("Search") box in navigation bar filter also the list of functions

I believe these, maybe together with a "search-and-replace" capability in query editor, would be huge enhancements for who, like me, @topherlandry and @jamesdixon at least, need to work on functions/stored procedures.

Well not exactly ten minutes work for @jakob, but not even days I think. Could also be a feature reserved for licensed users (I happily am one), but would love to have this.
Don't you?

jakob commented

Thanks for all your input! I only occasionally use functions myself, so I have to completely rely on your input for this, and it's great to hear so many suggestions.

If I understand correctly, the most important first step would be a read-only way to simply view a list of functions and their code. It should be possible to implement something like that quickly.

@trapias your list of suggestions is great, I'll try doing that. Instead of mixing functions and tables in the sidebar like pgAdmin does, I'd like to try something similar to Xcode. Xcode has a sidebar, and there are icons at the top of the sidebar (see screenshot) that let you switch between viewing files, issues, etc. In Postico there could be an icon for tables and an icon for functions, so you could switch between showing tables or functions in the sidebar.

xcode sidebar

Does anybody have a good idea for an icon to represent a function?

@topherlandry I'm curious, what competing product are you talking about? :)

Referring to Navicat Essentials. Their interface is really heavy and cluttered for what I need, which is minimalistic.

I like the idea of icons at the top. You could use the mathematical symbol for function as an icon, which is a lower case, italicized, cursive f(x).

I wanted to suggest the same tab-like bar for switching between data/functions/data types/etc. .
Most of the time one probably wants to use one or the other, so mixing them in the same tree has little advantage. It also stays out of the way of users who don't use functions at all.

As for an icon for functions 𝑓(x) should work well (MATHEMATICAL ITALIC SMALL F U+1D453)

@jakob I like the idea of icons on top of the sidebar, cool πŸ‘

That would be great! I think that is a very good solution. I like the idea for that icon.

@jakob any update on whether this might make it into the next release?

Cheers.

jakob commented

@jamesdixon I haven't started working on stored procedures yet. This feature is at least a couple of months away.

I like the concept.

Perhaps a simple 'edit' feature would allow you to copy the read-only
function to the SQL query window, similar to the query history, to allow
editing there.

Just don't reproduce the pgadmin "feature" where you get a stale copy of
the function if you forget to refresh the list. I've been burnt by this
more times than I would like to admit.

On Tue, Feb 2, 2016 at 6:08 AM, Jakob Egger notifications@github.com
wrote:

@jamesdixon https://github.com/jamesdixon I haven't started working on
stored procedures yet. This feature is at least a couple of months away.

β€”
Reply to this email directly or view it on GitHub
#72 (comment).

Michael Iverson

+1: Would very much like to see this feature in asap. Currently lacking it as a premium user, was expecting it to be in already because it's that vital to serious use of postgres.

+1 for this. Would very much love to leave pgAdmin behind, but it still has so many important features.

@jakob any update on this?

Also, as a premium user, I'm curious as to the process you're using to prioritize features? For example, I saw that basic support for Cockroachdb is being added, but that seems very low priority given that it's a relatively unknown database in beta compared to a feature like this (or others) that are highly requested and fundamental to working with Postgres.

jakob commented

@jamesdixon I try to prioritise features that lots of people want, obviously, because it is the right thing to do and also because that leads to more sales.

But just as important is the amount of time required to implement a feature. Adding support for CockroachDB was a couple of hours of work, and some parts (like the client side TLS certificate stuff) is also useful for PostgreSQL users.

Adding support for editing stored procedures will require some significant changes to the UI, specifically the sidebar. I've started this work, and but it will still take me time to complete. This is mostly UI work, which is the most time-consuming kind of work. While a simple logic change is often just a handful of lines that I need to add, a new view will require lots of design work and adding several new files. I rarely get it right on my first try, so I often start over or keep making changes to the UI until it works.

+1

+1

@jakob sorry, I did not see your previous reply. Thanks for the explanation.

That said, any update on this? I'm still having to bounce back between Postico and Valentina Studio (which is super-buggy) in order to edit my functions. It's a real pain.

Even basic support here would be a start. For example, rather than a major UI change, just being able to load functions from a folder in the left-hand nav into the query editor would be great.

Thank you!

@jakob any chance you might be able to let us know where this falls in the roadmap?

This appears to be a feature that the community is really interested given the feedback this thread has received. As mentioned above, the first implementation doesn't need to be perfect and doesn't need a complete UI change.

Sorry to beat a dead horse, but I'm just getting tired of having to use Valentina Studio for such a seemingly trivial task.

Thank you!

@jakob again, looking for an update on this feature. I just saw 1.1 released with no mention of this, yet there is support for the OS X touchbar. I'm sure most would agree this is less useful than some of the other features requested and only helps a very small subset of users.

I realize this stuff takes time to implement, but this issue is over a year old and something that many people have requested. Again, I don't believe that there needs to be a complete UI overhaul to make this happen in its simplest form.

Can you please provide an update? As a paying user, I'm admittedly getting a bit frustrated. Maybe it would help to have a public roadmap of what's next in the pipeline and maybe the ability to vote up features so that you're building what people need. Trello is a simple tool for this.

Thanks.

jakob commented

Sorry for not providing any updates on this for some time.

As I started working on stored procedures, I've found that significant UI changes will be required to add the feature in a coherent way. I don't want Postico to become an incoherent mess, so I'm not going to rush a half working solution out the door.

This feature will come eventually, but it will still take some time. I can't make any promises when there will be progress. It's not the highest priority for me right now, since it is a completely new feature. Fixing bugs and flaws in existing features has priority for me right now.

Please don't get me wrong; this is a feature dear to me (I use stored procedures a lot myself), and I know it is popular. But unfortunately it's not the only popular feature request.

Your idea for a public roadmap is definitely worth considering. I am a bit hesitant still. Keeping a road map up to date takes a lot of effort. And I really don't want to encourage people to adopt Postico because of features that I have promised for the future; I'd hope that people only choose Postico if it is the right tool for the task in its current state.

+100
I love Postico so much.
You are doing great work. Keep it up!

+1

+1

+1

+1, must have feature

+1

+1

grgur commented

This is extremely valuable to anyone using Postgrest

Would LOVE to have this. Am struggling editing the functions right now that I have to manage.

@jakob any update on when we might see this? thanks!

jakob commented

@jamesdixon weβ€˜ve not been working on this, and I canβ€˜t make any promises when weβ€˜ll get to work on this

9mm commented

+1

Please get this feature done

@miverson I'm with ya. Even something that simple would be huge!

@jakob any updates? No offense, but it's been over a year since you said you had started working on this. You mentioned that it's not a high priority compared to other features, yet it's the most requested feature as of March 2018. Can you please provide an update?

As @miverson suggested, this doesn't need to be fancy. Literally just adding a list of functions to the sidebar and being able to copy them into the query window would be a huge win.

I'm a huge fan of Postico (hence why I paid for it), but I am becoming increasingly frustrated with the way new features are prioritized.

@jakob - A lot of my colleagues want to move to Postico but they can't do because it doesn't support this feature. Pls consider this feature as a priority.

@miverson: technically it should be impossible to write a worse UI than pgadmin4.

I also agree, that visibility + copy-paste-ready code would suffice for now - thats all I'm using pgadmin for, but this program makes it as hard as possible to achieve this ... and after I hit cmd+q, it crashes as a final middle finger to the user!

9mm commented

Yes, I think if you threw modly bread and sticks at a piece of flypaper you would have a better UI than PGAdmin, yet thats what I'm also forced to use

I find it amazing that more than 2 years later the same people are asking for the same feature. I gave up on it ever coming -- which is a shame because I really liked Postico.

jakob commented

Hi folks!

Instead of complaining about pgAdmin here, please consider reporting feedback to their mailing list. I'm sure Dave Page and the development team would love to hear what you are struggling with (if you tone down the sarcasm a bit...). They do listen to user feedback.

I'm sorry that development of Postico isn't as fast as you'd like. Fixing all the little bugs takes a lot of time, and we're a small team, so we can only do a few major features at a time.

I don't really have any updates on this issue. All I can say is that I consider functions an important feature that I really want to have. I don't know how long it'll take, and if you need this feature, you'll need to use a different client. I'd love for Postico to have a feature like this, but we're just not there yet.

@jakob maybe it would help to share exactly what is coming next for Postico? I believe the issue here isn't a lack of respect for the development process, but instead an issue with communication.

I had previously suggested making some sort of public roadmap. Sure, maybe the features takes months to develop, but at least Postico users and prospective Postico users will have an idea of what to expect going forward.

3 years and still waiting for this. Holder of multiple licenses for business and personal use.

I've move from Mac to Linux for 2 years and this function still not present...

Just having a list of the functions and the ability to see the 'CREATE OR REPLACE' code would be more than enough for me. Thanks! We just bought 10 licenses.

@johnthuss agreed. That's all I'm looking for as well

Same here @jakob, have been using the paid version of Postico for years and the only feature I'm missing is a list of stored functions with their source code. It's an amazing app and this is literally the only missing feature. Happy to edit the functions manually in the query tab!

only reason i dont pay for this app is because its missing this feature.. even my ide has this feature..

@tim-walton the app is worth paying for already. The way I look at it is that if we don’t vote with our wallet then developers tend to drift off on to other things.

@senjaz while I agree with you, the developer has indicated in #608 that they are doing well with their license revenue. If that's the case, then they should be focused on features the community wants, i.e. function editing support, which has the most reactions by double of any other feature request. Instead, the developer has chosen to focus on things like dark mode and cockroach db support. It's frustrating when you've been waiting around for literally years for a feature that is so clearly valued by the community.

bstro commented

+1 – doing work with postgraphile/postgrest and would really appreciate this feature. I might end up purchasing a license without it, but the lack of this feature is my only hesitation.

Same same

Yes, It's been nearly 4 years since this was requested. I'm tired of opening pgadmin4 windows.

jakob commented

Hi everyone!

Postico 2 will have support for editing stored procedures and functions. We can't say how long it'll take us to release Postico 2, but you can already download a beta version here: https://eggerapps.at/postico2/

The beta version of Postico 2 only has a read-only list of functions. I know that it's not a full editor, but it's better than not showing functions at all.

(I already announced the beta earlier, but not everyone commenting here might have seen the announcement in #689, so I'm posting again. Apologies for spamming those of you who already know.)

Great to hear that Postico 2 is coming. However I find the UI for functions/procedures strange: Instead of grouping functions and procedures with the tables and views in the same schema, they are grouped at the top level into a separate tab.

So if I'm working on closely related tables, views and procedures those objects are all in the same schema and share a name prefix (so the table might be called kunde, the view kunde_select_active and procedures might be called kunde_insert, kunde_update, kunde_delete, kunde_abrechnen etc.). If all objects would be available in one group for the schema, they would be located next to each other in an alphabetical list. But with the current UI I constanty have to switch to another tab, find the schema and the object within it. This is annoying.

9mm commented

I don't know if this is a good spot to comment on Postico 2 as well, but the one thing keeping me from using it is it's no longer able to do an SQL query in one click. That's mostly the whole point of why I use Postico for many production servers.

Now, many clicks are involved and it just feels very clunky/clumsy to do a single query, and that it just saves every single one. I rarely am wanting to save what I'm doing. Maybe there can be a "Quick SQL" section above the one where it automatically stores it or something...

jakob commented

@doerwalter Thanks for the feedback. I usually have separate databases for separate projects, and I assumed that's how most people use PostgreSQL. I see that the way the interface works now is annoying when you have multiple projects / customers in one database and use schemas for grouping stuff. I'll think about this, but what I really like about the current UI is that functions are somewhat hidden and don't confuse people who don't use them...

@9mm This thread is already very long, so I created a new issue for your feedback (#698)

jakob commented

@martinjankoehler has been working on a graphical editor for stored procedures and functions, and we just merged it into the master build of Postico 2.

Please download the latest build of Postico 2 here: https://releases.postico.app

Looks promising!

Should we already report issues or should we wait a for few builds?

jakob commented

@qwesda Yes please report issues! (As new issues if possible, since this thread is already very long)