pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.72k stars 250 forks source link

Rework cargo-pgx with different abilities #14

Closed zombodb closed 4 years ago

zombodb commented 4 years ago

In the case of using Postgres instances already installed on your computer (likely through your OS' package manager) you'll need write access to the directories from pg_config --pkglibdir and pg_config --sharedir. You'll be on your own to sort that out.

I think maybe the typical workflow here is that you'll have one primary version of Postgres installed (via apt/dnf/brew/whatever), and then cargo pgx init will manage the other two. So for example, you might first invoke cargo pgx init like so:

$ cargo pgx init --pg12 /usr/bin/pg_config

At this point, cargo pgx init will only download/compile/install PG10 and PG11.

There'll be system requirements on (at least)

Additionally, the Postgres versions that cargo pgx init does compile itself will have '--enable-debug' '--enable-cassert' turned on so that in the case of core dumps, they can be debugged with gdb/lldb.

zombodb commented 4 years ago

Notes to self:

eeeebbbbrrrr commented 4 years ago

This is all coming along nicely. Here's a little screenshot of using some of these new cargo pgx commands. Please pardon the type-o in the middle!

Screen_Shot_2020-07-17_at_1 57 25_PM

diegopy commented 4 years ago

Awesome work! I was fighting with pgx install but this is really what's needed to make the workflow better. Have you guys considered a docker based workflow? I used dockerized postgres instances for development and works like a charm.I could help adding the support on pgx if that's something of interest.

eeeebbbbrrrr commented 4 years ago

Hey @diegopy! Thanks for this comment. We're working really hard to make cargo pgx better. We kinda missed the boat on this initial release. But we ain't afraid to admit it.

I just wrapped up a 1h 45m twitch stream showing off the work we've done on this issue (https://www.twitch.tv/videos/682684142). When you get bored, watch it (FF through the first 10mins or so).

Regarding Docker ... you're not the first person to suggest that. Once this issue is resolved, I think it might make sense to talk about it.

At some point, it seems to me that if you choose to use pgx, you've decided to become a PG developer. And with that comes some stress and responsibility. That said, if we can make all that disappear, I'm down!

eeeebbbbrrrr commented 4 years ago

Okay, I think I'm done with all of this.

Soon as one of these stupid GitHub Action test workflows that take way too long finishes with success, I'm going to merge. And start the process to publish a new release.

eeeebbbbrrrr commented 4 years ago

released to crates.io