Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate removing pg client requirement #926

Closed
jwoertink opened this issue Jan 20, 2023 · 2 comments · Fixed by #942
Closed

Investigate removing pg client requirement #926

jwoertink opened this issue Jan 20, 2023 · 2 comments · Fixed by #942
Labels
needs investigation A possible bug / better docs needed. Investigate further

Comments

@jwoertink
Copy link
Member

Many of the tasks require pg client tools to be installed like db.create just runs createdb ..., and db.drop runs dropdb ...... This is super convenient, and really easy to interface with. The downside is the require the install postgres client tools.

I'm pretty sure we can run all of these commands in straight SQL on the server, but I have no clue how. I've always used the client tools even before Lucky, so that's what I'm comfortable with. We will need to dive in to the code and find all the spots where CLI stuff is used. Including the stuff that uses psql. For example, how do you do a DB dump and DB restore from within raw SQL?

I really don't want to play the game of "as long as you don't use X, then you won't need client tools". If we can't make it an all or nothing, then I don't think it'll be worth the hassle.

@jwoertink jwoertink added the needs investigation A possible bug / better docs needed. Investigate further label Jan 20, 2023
@steve-bitdotio
Copy link

fwiw I believe dumping a postgres database without pg_dump is feasible but non trivial.

https://stackoverflow.com/questions/9433158/dumping-a-db-without-pg-dump

@jwoertink
Copy link
Member Author

I guess another option could be if the dump and restore are the only ones that require client tools, those could be abstracted to a sort of "plugin".... Then core Avram wouldn't need client tools, but also wouldn't have those readily available. Then when you do need them, you'd just require "avram/extras/pg_tools" or whatever...

jwoertink added a commit that referenced this issue Jun 24, 2023
* Removes the need for pg client tools when running create and drop db commands. Ref #926

* applyin some suggestions

* Adding the maintanence database defaulted to the username to ensure some DB is connected when there's no DB by the running username.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation A possible bug / better docs needed. Investigate further
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants