News for hackers. Stuff that matters.
Re:PostgreSQL IDE in VS Code by jsmith99 on Friday May 23, 2025 @12:58PM (#44074489)
I just use a MCP server (with copilot or cline) that has a read only login to my database.
Re:PostgreSQL IDE in VS Code by BoorishBears on Friday May 23, 2025 @02:29PM (#44075232)
Which is strictly worse than just giving the LLM access to the source of truth for the database.

You're adding a round trip to the database and the LLM and inserting a tool call in the conversation before it even starts generating any code.

And the reference Postgres MCP implementation doesn't include Postgres types or materialized views, and is one of the most widely used packages: Zed.dev's MCP server for example, is seemingly just a port of it and has the same problem.

Re:PostgreSQL IDE in VS Code by fwip on Friday May 23, 2025 @02:58PM (#44075490)
MCP also gives the LLM access to your example data, which can add clarity beyond what your schema alone provides.
Re:PostgreSQL IDE in VS Code by tempaccount420 on Friday May 23, 2025 @04:54PM (#44076521)
I don't see how a round trip of <500ms, which is equivalent to maybe 50 tokens, is worse than including many thousands more extra tokens in the prompt, just in case they might be useful. Not to mention the context fatigue.

If designed well - by suspending generation in memory and inserting a <function_result>, without restarting generation and fetching cache from disk - the round trip/tool call is better (costs the equivalent of 50 tokens for waiting + function_result tokens).

Re:PostgreSQL IDE in VS Code by BoorishBears on Saturday May 24, 2025 @01:34AM (#44078988)
You're dealing with the full TTFT x2 + the tokens all the prompts of all your MCPs before you even get to that round trip to the DB.

And you don't have to wonder about "if designed well": the reference implementation that's getting 20k downloads a week and getting embedded in downstream editors is is not designed well and will make the round trip every time and still not give the LLM the full information of the table.

Most MCP implementations are crappy half-assed implementations in similar fashion because everyone was rushing to post how they added <insert DB/API/Data Source> to MCP.

And if you're worried about "context fatigue" (you mean LLMs getting distracted by relevant information...), you should 100% prefer a well known schema format to N MCP prompt definitions with tool usage instructions that weren't even necessarily tuned for the LLM in question.

LLMs are much more easily derailed by the addition of extra tools and having to reason about when to call them and the results of calling them, than they are a prompt caching friendly block of tokens with easy to follow meaning.

Re:PostgreSQL IDE in VS Code by nsonha on Friday May 23, 2025 @06:32PM (#44077197)
The schema in the db should be the source of truth and an MCP server like that is the most flexible, can work with any ORM set up
Re:PostgreSQL IDE in VS Code by wredcoll on Friday May 23, 2025 @07:21PM (#44077497)
What source of truth? If you have access to the database then you have the actual truth right there.
Re:PostgreSQL IDE in VS Code by layoric on Friday May 23, 2025 @05:22PM (#44076744)
Out of interest.. does the resultant data get used by the LLM or just generating SQL, executing and returning separately?
Re:PostgreSQL IDE in VS Code by maxluk on Friday May 23, 2025 @05:33PM (#44076834)
PM on the project here - The results from the query are generally not used by the LLM. In agent mode though, during query planning, the agent may retrieve sample of the data to improve precision of the queries. For example, getting distinct values from dimensional table to resolve filter condition from natural language statement.
Re:PostgreSQL IDE in VS Code by layoric on Friday May 23, 2025 @06:30PM (#44077184)
Thanks. I worry about these kind of tools connecting to production databases.. Especially considering how easy it is to switch out LLM endpoints, where that data is going, how it is retained, the context etc becomes a bit of a privacy nightmare..
Re:PostgreSQL IDE in VS Code by maxluk on Friday May 23, 2025 @06:49PM (#44077293)
Absolutely valid concern. Our extension connects to LLMs through Github Copilot. Github Copilot is Microsoft product and offers variety of enterprise plans, which enables your IT to approve what can be used for what kind of data. This gives you a clear path towards compliance with your enterprise requirements.
Re:PostgreSQL IDE in VS Code by layoric on Friday May 23, 2025 @08:02PM (#44077719)
Makes sense. Appreciate the responses. Honestly though, as a person outside the US, I'm removing my dependence on US company IT tools and infrastructure, GitHub, VSCode, AWS etc, enterprise or otherwise.. Congrats on the project though.
Re:PostgreSQL IDE in VS Code by nikcub on Friday May 23, 2025 @06:55PM (#44077329)
Yep - I wrote a similar tool that would dump the schema, plugins and some example rows into a markdown file and found that MCP postgres server with tool calling works a lot better.