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

Automatically manage database when running scripts/test.sh #3389

Merged
merged 16 commits into from
Jun 30, 2023

Conversation

dullbananas
Copy link
Collaborator

This removes the need to manually setup the database or start/stop the server. Also, having control over the whole cluster configuration prevents issues with user permissions and authentication.

@Nutomic
Copy link
Member

Nutomic commented Jun 28, 2023

What is this cluster you are talking about? Basically you are initializing a new postgres database with files in the working directory?

@dullbananas
Copy link
Collaborator Author

A database cluster is a directory with its own collection of databases and configuration (including authentication and users/roles). A server process uses 1 cluster. https://www.postgresql.org/docs/current/creating-cluster.html

This cluster is stored in dev_pgdata.

The *.PGSQL.* files are 2 files that only exist while the server is running: a lock file, and a socket that's used to connect to the server.

@dessalines
Copy link
Member

Running this from the scripts directory will give you

./test.sh: line 7: scripts/start_dev_db.sh: No such file or directory

@dullbananas
Copy link
Collaborator Author

Running this from the scripts directory will give you

./test.sh: line 7: scripts/start_dev_db.sh: No such file or directory

I fixed it

Copy link
Member

@Nutomic Nutomic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it and works fine.

@Nutomic Nutomic merged commit 7d3894d into LemmyNet:main Jun 30, 2023
@dullbananas dullbananas deleted the easy-db branch July 7, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants