Show HN: Postgres Language Server

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Civic Auth - Auth in Less Than 5 Minutes
Civic Auth comes with multiple SSO options, optional embedded wallets, and user management — all implemented with just a few lines of code. Start building today.
www.civic.com
featured
InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
  1. libpg_query

    C library for accessing the PostgreSQL parser outside of the server environment

    Generally I agree that this would be great to have, and Postgres does have a set of libraries it already maintains as part of the main source tree (i.e. libpq, etc), and there is a shared set of code between the backend and the "frontend" (https://github.com/postgres/postgres/tree/master/src/common). So theoretically you could imagine the parser moving into that shared code portion, sharing code but not necessarily requiring linking to a library from the backend.

    However, the challenge from what I've understood from past conversations with some folks working on Postgres core is that the parser is currently heavily tied into the backend - note the parser isn't just the scan.l/gram.y file, but also the raw parse node structs that it outputs. You can see how many files we pull in from the main tree that are prefixed with "src_backend": https://github.com/pganalyze/libpg_query/tree/15-latest/src/...

    Further, there isn't a canonical way to output node trees into a text format today in core, besides the rather hard to work with output of debug_print_parse - there have been discussions on -hackers to potentially utilize JSON here, which may make this a bit easier. Note that in libpg_query we currently use Protobuf (but used to use JSON), which does have the benefit of getting auto-generated structs in the language bindings - but Protobuf is not used in core Postgres at all today.

    All in all, I think there is some upstream interest, but its not clear that this is a good idea from a maintainability perspective.

  2. Civic Auth

    Auth in Less Than 5 Minutes. Civic Auth comes with multiple SSO options, optional embedded wallets, and user management — all implemented with just a few lines of code. Start building today.

    Civic Auth logo
  3. postgres_lsp

    Discontinued A Language Server for Postgres [Moved to: https://github.com/supabase-community/postgres-language-server]

  4. language-server-protocol

    Defines a common protocol for language servers.

    hey HN. this is a Language Server[0] designed specifically for Postgres. A language server adds features to IDEs (VSCode, NeoVim, etc) - features like auto-complete, go-to-definition, or documentation on hover, etc.

    there have been previous some attempts at adding Postgres support to code editors. usually these attempts implement a generic SQL parser and then offer various "flavours" of SQL.

    This attempt is different because it uses the actual Postgres parser to do the heavy-lifting. This is done via libg_query, an excellent C library for accessing the PostgreSQL parser outside of the server. We feel this is a better approach because it gives developers 100% confidence in the parser, and it allows us to keep up with the rapid development of Postgres.

    this is still in early development, and mostly useful for testers/collaborators. the majority of work is still ahead, but we've verified that the approach works. we're making it public now so that we can develop it in the open with input from the community.

    a lot of the credit belongs to pganalyze[1] for their work on libg_query, and to psteinroe (https://github.com/psteinroe) who the creator and maintainer of the LSP.

    [0] LSP: https://microsoft.github.io/language-server-protocol/

    [1] pganalyze: https://pganalyze.com/

  5. nil

    NIx Language server, an incremental analysis assistant for writing in Nix.

    This looks nice!

    As someone interested in developing a client for it, I'm interested in couple of things: what are the features supported by it currently, the tweak-able configuration that can be passed to it and the various code action available. I like the way nil language server has documented it (https://github.com/oxalica/nil/tree/main/docs). Is there something equivalent available for this ?

  6. vscode-postgres

    PostgreSQL extension for vscode providing explorer, highlighting, diagnostics, and intellisense

    The vscode-postgres extension is pretty good for crafting queries.

    https://github.com/Borvik/vscode-postgres

  7. Eclipse Che

    Kubernetes based Cloud Development Environments for Enterprise Teams

    1. yes this is possible, although it depends on your IDE. Here is a relevant discussion for eclipse (which also links to the VSCode implementation): https://github.com/eclipse/che/issues/4609. Note: i also didn't know how this worked, so I learned something today too.

    2. Yes, absolutely. Feel free to reach out to me directly, or just start contributing directly if you want

  8. mason-registry

    Core registry for mason.nvim.

    Can you try to get it added to Mason so people don't have to try and do a custom install?

    https://github.com/mason-org/mason-registry/

  9. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  10. declarative-schemas

    fwiw, I personally am interested in this approach too[0]. I keep running into roadblocks around the ordering of events and some of the hairy issues around "destructive" actions (eg: renaming columns). i think we can get there, especially once we make progress with this LSP.

    There are other notable mentions in this space:

    Reshape: https://fabianlindfors.se/blog/schema-migrations-in-postgres...

    Atlas: https://atlasgo.io/

    [0] https://github.com/kiwicopple/declarative-schemas

  11. atlas

    Manage your database schema as code (by ariga)

    fwiw, I personally am interested in this approach too[0]. I keep running into roadblocks around the ordering of events and some of the hairy issues around "destructive" actions (eg: renaming columns). i think we can get there, especially once we make progress with this LSP.

    There are other notable mentions in this space:

    Reshape: https://fabianlindfors.se/blog/schema-migrations-in-postgres...

    Atlas: https://atlasgo.io/

    [0] https://github.com/kiwicopple/declarative-schemas

  12. postgres-ast-deparser

    A PostgreSQL AST toolkit and deparser, written in pure plpgsql

    actually I forgot to mention this one to Lukas in all the chaos leading up to our Launch Week. I will do it now

    we talked in the past about using their library to extend some of Dan Lynch's work (https://github.com/pyramation/postgres-ast-deparser) to create a sort of "postgres package registry" with dynamic DDL introspection. No progress on that one yet, but I'm hopeful that we'll find the bandwidth for it one day.

  13. pglast

    PostgreSQL Languages AST and statements prettifier: master branch covers PG10, v2 branch covers PG12, v3 covers PG13, v4 covers PG14, v5 covers PG15, v6 covers PG16, v7 covers PG17

    Can't you just give some love to the issue https://github.com/pganalyze/libpg_query/issues/44 instead ? As I said before this would be very helpful for the community because there are a lot of libraries that use libpg_query and cannot be used on windows (f.e see https://github.com/lelit/pglast/issues/7).

    It seems that the only problem for fixing the problem is:

    > Thanks for the offer, but the problem is our team being time limited / having an engineer with a Windows machine ready to take this on, not that we wouldn't want to pay someone to work on it :)

    (https://github.com/pganalyze/libpg_query/issues/44#issuecomm...)

    Hosting the LSP elsewhere is really needed since if people wanted to go that way they could use Remote ssh (https://code.visualstudio.com/docs/remote/ssh) to host the whole dev environment on linux and connect to it.

    Thank you

  14. pspg

    Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.

    > I am regularly surprised how bad the tooling is for SQL/databases.

    This. I'd really like to have a working SQL pretty printer/formatter. Psql is great, but lacks autocompletion in several places.

    That said, a big shoutout to pspg (https://github.com/okbob/pspg) - an excellent pager for psql (also for general csvs).

  15. PostgreSQL

    Mirror of the official PostgreSQL GIT repository. Note that this is just a *mirror* - we don't work with pull requests on github. To contribute, please see https://wiki.postgresql.org/wiki/Submitting_a_Patch

    Generally I agree that this would be great to have, and Postgres does have a set of libraries it already maintains as part of the main source tree (i.e. libpq, etc), and there is a shared set of code between the backend and the "frontend" (https://github.com/postgres/postgres/tree/master/src/common). So theoretically you could imagine the parser moving into that shared code portion, sharing code but not necessarily requiring linking to a library from the backend.

    However, the challenge from what I've understood from past conversations with some folks working on Postgres core is that the parser is currently heavily tied into the backend - note the parser isn't just the scan.l/gram.y file, but also the raw parse node structs that it outputs. You can see how many files we pull in from the main tree that are prefixed with "src_backend": https://github.com/pganalyze/libpg_query/tree/15-latest/src/...

    Further, there isn't a canonical way to output node trees into a text format today in core, besides the rather hard to work with output of debug_print_parse - there have been discussions on -hackers to potentially utilize JSON here, which may make this a bit easier. Note that in libpg_query we currently use Protobuf (but used to use JSON), which does have the benefit of getting auto-generated structs in the language bindings - but Protobuf is not used in core Postgres at all today.

    All in all, I think there is some upstream interest, but its not clear that this is a good idea from a maintainability perspective.

  16. Visual Studio Code

    Visual Studio Code

  17. language-tools

    ⚡ High-performance Vue language tooling based-on Volar.js

    [4] https://github.com/vuejs/language-tools/issues/3200

  18. vetur

    Vue tooling for VS Code.

  19. sqlfluff

    A modular SQL linter and auto-formatter with support for multiple dialects and templated code.

    It has tons of annoying quirks, but I couldn't imagine running a DBT project without it: https://github.com/sqlfluff/sqlfluff

  20. CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Why You Shouldn’t Invest In Vector Databases?

    12 projects | dev.to | 24 Apr 2025
  • Reliably Replicating Data Between PostgreSQL and ClickHouse

    4 projects | news.ycombinator.com | 22 Feb 2025
  • Snyk security researcher deploys malicious NPM packages targeting Cursor.com

    6 projects | news.ycombinator.com | 13 Jan 2025
  • Validate your Jenkinsfile with the vscode plugin vscode-jenkins-pipeline-linter-connector and the LLMs large model

    4 projects | dev.to | 25 May 2024
  • How not to change PostgreSQL column type

    2 projects | news.ycombinator.com | 7 May 2024

Did you know that TypeScript is
the 1st most popular programming language
based on number of references?