▲ | Database Linting and Analysis for PostgreSQL(pglinter.readthedocs.io) | ||||||||||||||||||||||||||||
99 points by fljdin 5 days ago | 19 comments | |||||||||||||||||||||||||||||
▲ | phartenfeller 6 hours ago | parent | next [-] | ||||||||||||||||||||||||||||
We are also working on a database linter. Currently focusing on Oracle but we will support Postgres soon too. Rules can either run queries against the DB (e. g. foreign key without index) or use our parser to check code SQL, PL/SQL, and pgSQL soon (naming standards, security and performance issues, etc.). We currently have over 280 rules [1]. The tool runs as a lange server during development or as a CLI so you can use it in your automations. Its more enterprise focused, an admin can create configurations that get applied to all developmers. | |||||||||||||||||||||||||||||
▲ | gurjeet 11 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Why does it have to be an extension? At a cursory glance I did not see any checks that cannot be performed by a client/application that connects to the database. Being an extension gives it privileges that wouldn't be available to a client application. | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
▲ | thewisenerd 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
mirroring all the comments about this _needing_ to be an extension.. in theory, one should be able to extract the "rule" definitions [1] and have it run with a conn str; instead of this _needing_ to be an extension. in practice though, query plan analysis and missing indexes is a bigger use-case; since it's bad queries that take down the db.. and i see no rules here to help with that. [1] https://github.com/pmpetit/pglinter/blob/9a0c427fac14840a7d6... | |||||||||||||||||||||||||||||
▲ | davedx 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
It’s a good idea, but this kind of thing is my problem with linters: “B006: Tables with uppercase names/columns” They usually end up expanding in scope into places they shouldn’t be. Consider also react linters, full of rules that shouldn’t always be blanket applied or create tons of pointless busywork. My ORM will decide the naming of my database tables, thank you very much. It’s much more qualified than a linter, which should stay in its lane. | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
▲ | lervag 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Related tools: - https://github.com/kaaveland/eugene/ - https://github.com/supabase-community/postgres-language-serv... | |||||||||||||||||||||||||||||
▲ | clintonb 13 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Seems nice. It would be better if it could be run as a script or agent, instead of a plugin, so it could work against hosted installations on AWS or Google Cloud (both of which limit extensions). | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
▲ | mannyv 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
I expect that the thing that makes it an extension is "T005: Tables with potential missing indexes (high sequential scan usage)." Can you get that data on the outside? | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
▲ | landsman 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Checks for DB migrations in GitHub Pull Request would be really nice! | |||||||||||||||||||||||||||||
▲ | SteveLauC 8 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Interesting project. Has anyone tried adopting something like this in their database cluster? I would like to know how it performs in practice. Is it useful? | |||||||||||||||||||||||||||||
▲ | fljdin 5 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
pglinter is a PostgreSQL extension that analyzes your database for potential issues, performance problems, and best practice violations. Written in Rust using pgrx, it provides deep integration with PostgreSQL for efficient database analysis. | |||||||||||||||||||||||||||||
▲ | ddxv 11 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||
Will this support Postgres18 soon? I see the docs say it currently supports Postgres18 beta 2, so possibly just the docs need to be bumped? | |||||||||||||||||||||||||||||
▲ | neves 10 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||
Looks nice. Do you know any similar tools that work for other databases? |