On Tuesday, 29 June 2021 at 18:25:52 UTC, someone wrote:
Can you elaborate why you went your own way coding your own bindings to pglib instead of using the existing ones ?

Not who you were asking but: they just don't work.

Maybe they don't support Windows for one reason or another.

Maybe their abstraction for whatever reason isn't able to handle basic types for the database backend (true story).

Maybe they have weird, non-nonsensical errors, or for some reason just can't connect when nothing else is wrong.

And maybe, sometimes they decide to just crash for random reasons. e.g. I tried to use the Hunt database library recently, and it's dtor would crash because it was missing a null check or something.

So I (and likely others) decide to just write our own. In my own case I just wanted to run super simple queries with super simple results, so made a very tiny wrapper around postgres' C library: https://github.com/BradleyChatha/dubstats2/blob/master/d/database/source/database.d

I used a tool called DStep to automatically convert the headers I needed over to D, and with a few manual tweaks, everything just worked. No hassle, no random shenanigans, I could actually _start the project_ instead of wrestling with 20 different libraries.

There's a comment in the top of that file that describes my general feelings towards most dub libraries.

If you don't stick with the top libraries, you're basically in a barren wasteland in terms of "will this shit even work?" and "I could've just written my own version in the hours/days it's taken me to get this damn thing to do anything".

Reply via email to