AlexTatiyants / pev

Postgres Explain Visualizer
MIT License
2.77k stars 192 forks source link

Submit plan programmatically #19

Closed hesselink closed 6 years ago

hesselink commented 8 years ago

Is it possible to submit a plan programmatically? We have a tool which can now generate the analyze output which we then copy/paste, but it would be nicer to have it send it to pev immediately.

dorian-marchal commented 7 years ago

As a workaround, what you can do is:

scarroll32 commented 6 years ago

@AlexTatiyants I agree it would be awesome to submit the plans with a single command. Would be agreeable to provide an API endpoint to submit the plans to (in json format) on the hosted version?

I'd be happy to submit a PR to support this.

AlexTatiyants commented 6 years ago

I'm not opposed to the idea. However, I need to clarify something. Pev is a web app. It has no backend and therefore cannot be POSTed to. To give it the plan, you would need to supply a query string parameter on a GET. And, I think there are limitations on how big the parameter can be.

scarroll32 commented 6 years ago

Hi Alex, OK I didn't understand then whole thing is running in a browser without a backend. That's pretty awesome. Yes I think we would have problems with complex plans and GETs.

A simple Express backend would do it, but then it becomes a web app with requirements for hosting etc.