News for hackers. Stuff that matters.
Re:Show HN: Postgres Language Server by codeptualize on Sunday August 06, 2023 @08:04AM (#37021091)
Letss gooo!! Supabase keeps on delivering things that I need.

I am regularly surprised how bad the tooling is for SQL/databases. Especially that there is no decent formatter that supports plpgsql, and doesn't absolutely mangle your queries (sometimes actually breaking your queries..).

Best options atm are imo TablePlus and DataGrip, I have tried a bunch of options in vscode and although there are useful tools, it's all not really there.

(Also excited to see what else they will release this launch week!)

Re:Show HN: Postgres Language Server by kshahkshah on Sunday August 06, 2023 @09:53AM (#37021927)
Check out Beekeeper Studio
Re:Show HN: Postgres Language Server by bbkane on Sunday August 06, 2023 @10:35AM (#37022397)
Love Beekeeper Studio!
Re:Show HN: Postgres Language Server by rapind on Sunday August 06, 2023 @11:48AM (#37023173)
A monthly fee? No thanks.
Re:Show HN: Postgres Language Server by kshahkshah on Sunday August 06, 2023 @12:13PM (#37023451)
Sheesh. It's open source, has a free version, and then a premium version so the bootstrapped, not-VC backed, creators avoid starving themselves and their families while working on the tool...
Re:Show HN: Postgres Language Server by gabereiser on Sunday August 06, 2023 @12:49PM (#37023882)
Sadly, this is why this space has laggard for so long. Devs don’t want to pay for tooling but expect others to pay for their product.
Re:Show HN: Postgres Language Server by Xymist on Sunday August 06, 2023 @02:12PM (#37024898)
There is an important differentiator, though. I'm happy to pay _once_ for tooling as a product, and potentially for subsequent major versions. I am not, however, willing to be a source of MRR.
Re:Show HN: Postgres Language Server by gabereiser on Sunday August 06, 2023 @10:16PM (#37029236)
I generally agree with this. There’s only one or two tools I’ll begrudgingly subscribe to with this model. I would be way more inclined to use the tools if it were a single purchase and I’ll upgrade when I feel like it. I’m looking at you JetBrains and Adobe…
Re:Show HN: Postgres Language Server by alex23478 on Monday August 07, 2023 @10:39AM (#37035070)
JetBrains offer perpetual fallback licenses together with their yearly subscriptions: https://sales.jetbrains.com/hc/en-gb/articles/207240845-What...
Re:Show HN: Postgres Language Server by gabereiser on Tuesday August 08, 2023 @12:05AM (#37044398)
Then nag you and auto update you to the latest version without a perpetual license.
Re:Show HN: Postgres Language Server by rathboma on Sunday August 06, 2023 @02:02PM (#37024783)
Hi! I'm the bootstrapped, non VC backed creator of Beekeeper Studio. My open source version is good, probably too good, lol.

Thanks for the mention!

Re:Show HN: Postgres Language Server by mkl on Sunday August 06, 2023 @05:50PM (#37027233)
Please make your screenshot carousel stop automatically rotating after it is interacted with; it's really hard to take in the details of the screenshots.
Re:Show HN: Postgres Language Server by rathboma on Sunday August 06, 2023 @06:32PM (#37027599)
Good idea, I'll do that, thanks!
Re:Show HN: Postgres Language Server by spiderice on Sunday August 06, 2023 @06:18PM (#37027488)
> probably too good, lol

Lol, this is too true. I use Beekeeper Studio every day. Every once in a while I think to myself, "I should see if the full version is worth paying for yet". Then I check out the features and, while they look great, the free version has absolutely everything I need.

Thanks for such a great product. I'll stop freeloading eventually!

Re:Show HN: Postgres Language Server by rapind on Sunday August 06, 2023 @02:31PM (#37025090)
The pricing looks like SaaS only. I'm happy to pay a one-time fee for software (even when it doesn't include future versions), but not a subscription, unless of course there is a common sense benefit to a subscription (like paying for additional support on top of the fixed price).

Anyways, once taking the time to re-read the pricing screen subtleties it is sort of a one-time fee (billed as one year of subscription to gain indefinite use), so kudos to the developer, but I have to say it's really non-obvious to me at least.

Also the availability of a community edition is great, but again non-obvious.

Re:Show HN: Postgres Language Server by kshahkshah on Monday August 07, 2023 @08:53AM (#37033750)
That's good feedback for the developer for sure.
Re:Show HN: Postgres Language Server by fragmede on Sunday August 06, 2023 @01:25PM (#37024396)
The stereotype of software devs being the absolute cheapest bastards, despite being well paid, lives on. These people put time and effort into building a thing, and giving them money for it is reprehensible?
Re:Show HN: Postgres Language Server by VincentEvans on Sunday August 06, 2023 @01:54PM (#37024691)
I’m not the people you are responding to, but I’ll share my take as a dev who buys some tools and turns my nose at the others.

The difference is - whether it’s a purchase or a subscription.

I’ll happily buy a tool, and happily will buy upgrades every so often.

I will absolutely resist paying for subscriptions unless you are delivering some sort of continuous service and I won’t be fooled by gimmicky cloud integrations just to make that claim.

Re:Show HN: Postgres Language Server by thiht on Sunday August 06, 2023 @02:30PM (#37025081)
Same for me, I avoid subscriptions as much as possible.

I’m ok with the model of TablePlus however: pay for a license, it’s valid for a year, and at the end of the year you keep the current version available forever but no more updates. And you get a discount if you decide to renew your license

Re:Show HN: Postgres Language Server by VincentEvans on Sunday August 06, 2023 @08:51PM (#37028623)
Agreed, a subscription model where you end up “owning” a particular version after reaching some milestone is ok with me. Sort of like a payment plan.

I’ve been a happy subscriber to Jetbrains Toolbox that has a similar model for many years now, and have interrupted and later resumed my subscription while being able to use the software in between.

100% against a subscription where you no longer able to use the software the moment you cancel your subscription after paying for years. Looking at you Adobe.

Re:Show HN: Postgres Language Server by codeptualize on Sunday August 06, 2023 @12:04PM (#37023339)
Will try!

It looks quite similar to table plus, any killer features I’m overlooking?

Re:Show HN: Postgres Language Server by cpursley on Sunday August 06, 2023 @10:01AM (#37022002)
Agree, would love to see this built into TablePlus.

What I really want is a state-based way to define my database. EdgeDB & Prism have made some progress here but they really only handle table changes. Really wish this were built into Postgres somehow (or any solid migration story).

I want to be able to define my tables, views, functions and everything and the engine behind it automatically figures out all the necessary changes. For example, change a table (add a column or something) and it is smart enough to update any dependent views and functions. Including handling of data migrations.

Re:Show HN: Postgres Language Server by kiwicopple on Sunday August 06, 2023 @10:17AM (#37022207)
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/

A "custom" example on GitLab: https://gitlab.com/delibrium/delibrium-postgrest/-/tree/mast...

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

Re:Show HN: Postgres Language Server by rotemtam on Sunday August 06, 2023 @10:29AM (#37022343)
Thanks for the mention of Atlas <3
Re:Show HN: Postgres Language Server by cpursley on Monday August 07, 2023 @06:32AM (#37032622)
Glad to hear that! We’re using Hasura (started before Supabase was a thing, otherwise we’d be using Supabase) and their Rails inspired migration is quite good. However, we’ve run into the problem of modifying functions and views that are dependent on other things (often views and custom functions). It’s a real bear to make changes - it involves dropping multiple views/functions (in the correct order) before applying the new migration - and then carefully adding it all back and hoping nothing breaks (sometimes we miss things).

I don’t like the solution of “stop using views and functions” as I prefer to use use the full power of Postgres (everything close to the data, less application level logic, great plugins). Not sure what approach should be taken to creat a state based migration solution, but it feels like the tech around Postgres, language servers, etc has matured enough to solve the issue in an automated way.

Re:Show HN: Postgres Language Server by cpursley on Monday August 07, 2023 @06:34AM (#37032639)
On that topic, I’d love to see database logic presented in a folder like structure in the way that were used to with code (instead of just hidden in migration files. Maybe language server can help with that.
Re:Show HN: Postgres Language Server by codeptualize on Sunday August 06, 2023 @12:10PM (#37023406)
Supabase cli has a decent diffing option to generate migrations (not sure what they use, but it’s open source), it works quite decent for schema changes.

Not as advanced as you describe though, it won’t handle your data migrations.

Re:Show HN: Postgres Language Server by bob1029 on Sunday August 06, 2023 @11:08AM (#37022773)
> I am regularly surprised how bad the tooling is for SQL/databases

Agreed. Even when using something open like SQLite, you will find a lot of difficulty in answering simple (to me) questions like "how do I parse this command text into an AST".

Re:Show HN: Postgres Language Server by j45 on Sunday August 06, 2023 @12:22PM (#37023557)
SequelPro is quite decent for MySql.

Tooling for Postgres seems to be more for the technical who prefer command line than not.

Re:Show HN: Postgres Language Server by jonquest on Sunday August 06, 2023 @03:30PM (#37025664)
Sequel Ace is the forked and actively developed version of Sequel Pro. I don't think the owners of Sequel Pro ever announced it was abandoned, but the GitHub repo's lack of what appears to be any real development activity certainly suggests it is.
Re:Show HN: Postgres Language Server by j45 on Sunday August 06, 2023 @03:59PM (#37025983)
That's great to know, thanks, I'll try it out.

At this point my muscle memory is on the Sequel Pro shortcut keys, except I'm finding myself around Postgres more and more.

Re:Show HN: Postgres Language Server by mbork_pl on Sunday August 06, 2023 @03:19PM (#37025552)
> 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).

Re:Show HN: Postgres Language Server by WorldMaker on Monday August 07, 2023 @03:22PM (#37039557)
SQL pretty printers have probably the widest variety of possible "pretty" options to support. I've seen so many disagreements over the years on how the right way to print SQL is. For instance, I've gotten huge fights by saying that I prefer "Sentence case" (example: `Select * from someTable where someId in (select otherId from otherTable)`; only "top-level" introductory keywords get a single capital letter to make them easier to scan for like you are reading prose, kind of, and no semicolons unless entirely required such as the termination of a Merge statement) versus how many people still seem to be telnetting their SQL in 2023 from terminals or punch cards that mandate shouting SQL keywords in all caps everywhere.

(ETA: Being a big fan of Merge statements for a bunch of ETL trivia is partly how I got to "Sentence case". Merge statements are tough to read at the best of times and eliminating extraneous casing changes as noise by using more lower-case than not was a very useful thing to me. I don't need to highlight keywords versus everything else in a modern syntax highlighting bath, so casing becomes useful for way finding. A lower-case "select" is in the middle of something else.)

Re:Show HN: Postgres Language Server by tracker1 on Monday August 07, 2023 @06:34PM (#37041869)
With A formatter in place, I'm generally much happier, even if I don't always agree with the structure.
Re:Show HN: Postgres Language Server by epgui on Sunday August 06, 2023 @11:02PM (#37029576)
It has tons of annoying quirks, but I couldn't imagine running a DBT project without it: https://github.com/sqlfluff/sqlfluff
Re:Show HN: Postgres Language Server by pjmlp on Monday August 07, 2023 @05:19AM (#37032167)
Tooling is quite good on comercial space, now on free beer side, it is another matter.
Re:Show HN: Postgres Language Server by tracker1 on Monday August 07, 2023 @06:32PM (#37041855)
FWIW, the MS SQL tooling is decent... Hopefully this goes as far to understand the db/schema/table structure of a connected database.