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

Project Status #38

Open
theAkito opened this issue May 3, 2023 · 6 comments
Open

Project Status #38

theAkito opened this issue May 3, 2023 · 6 comments

Comments

@theAkito
Copy link

theAkito commented May 3, 2023

Is this project still alive?

Are contributions still welcome i.e. would they be possibly merged?

@fmeringdal
Copy link
Owner

I don't actively add code to this repo anymore as you might have guessed from the commit history. What did you have in mind to contribute?

@theAkito
Copy link
Author

theAkito commented May 3, 2023

Since issues like #16, #23, #37 pretty much break the entire Docker setup, this project is currently unusable in a Docker only setup. Trying to get it to run since a while, but these one in a kind compile time SQL checks really make the deployment very hard.

Compile time checked sql queries are extremely useful for catching very common bugs, so that will not be disabled.

Source

I see the point of this, but if one is doing crazy safety/integrity stuff like this, one ought to also put in the effort to make it actually work. One safe broken program is more useless than a running one without the safety. & not being able to run this on Docker basically means you are excluding it from any meaningful use, besides a one-man local server for testing or something.
(There also could've just been a switch to disable it temporarily, until the feature is fixed.)
The (new) migration is also not included in the Alpine image, which should actually be the default. The libc dependent images are actually secondary, when using Docker.

Soo, my status quo is now, that I finally fixed the issue of not being able to connect to PostgreSQL during build. At first, I did not understand the error, because I couldn't believe, that the app is connecting to a database during build. Only the aforementioned Github issues had the power to enlighten my poor mind.
Experiences like this are usually a sign of bad and/or inaccessible documentation.
At second, the actual SQL query tests aren't running, because I'm now not sure, whether the database needs the new migration or something. Not sure, how to populate the database, just to make the tests work. Do I really need to manually populate the database somehow or do I need to run the migration locally as mentioned in one of the issues or what should be done here?
Again, a big documentation issue.

If I'm going to make this run, I'd be willing to present it as a contribution to this project. 🙂

@fmeringdal
Copy link
Owner

Compile time checked sql queries are extremely useful for catching very common bugs, so that will not be disabled.

I have somewhat changed my mind on this since then. A proper test suite for the DB queries are much more useful than just syntax checking the queries.

Any contribution would certainly be welcome to improve the status quo of the repo!

@theAkito
Copy link
Author

theAkito commented May 3, 2023

I have somewhat changed my mind on this since then. A proper test suite for the DB queries are much more useful than just syntax checking the queries.

Ah, I see. Good to know. Does that still imply a working PostgreSQL connection during build time, which includes supposedly(?) tests?

Any contribution would certainly be welcome to improve the status quo of the repo!

Nice. So, could you please tell me whether I need to populate the database, to make the build work or what else I would need to do, to make the SQL related checks pass? 🙂

@fmeringdal
Copy link
Owner

Ah, I see. Good to know. Does that still imply a working PostgreSQL connection during build time, which includes supposedly(?) tests?

I don't think it needs to connect to psql at all during compilation. A separate test phase should check for DB failures or sql syntax issues and so on.

Nice. So, could you please tell me whether I need to populate the database, to make the build work or what else I would need to do, to make the SQL related checks pass? 🙂

Are you asking for what is required to build the current repo? Then I believe the issue you linked to describes a way to do it by running the migration with sqlx cli before starting the app. To be fair, I haven't started this app in at least a year, so not completely sure. Feel free to experiment and implement a better approach here!

@theAkito
Copy link
Author

theAkito commented May 7, 2023

I don't think it needs to connect to psql at all during compilation.

I could never get it to finish compiling, because connection to the PostgreSQL database timed out during compilation. 😀

Then, I provided the connection and the SQL tests started failing...

Then I believe the issue you linked to describes a way to do it by running the migration with sqlx cli before starting the app.

The way I understood this, the database had be working & then you apply the migration utility to "upgrade" the existing, working database, so it keeps working.
Since I am attempting to run the whole thing for the first time, I do not have any data in the database. It's empty. So, technically, nothing to "migrate" there.

Feel free to experiment and implement a better approach here!

Thanks. I'll contribute my improvements, once I have it all running. Although, we need to figure out the database stuff, first. 😁

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

No branches or pull requests

2 participants