-
Notifications
You must be signed in to change notification settings - Fork 20
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
refactor: migrate from sea-orm to sqlx #87
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good! Had a quick look and left a few comments.
LGTM, but we can't merge with tests failing. So either you need to comment out the tests in CI for now, or fix tests in this PR. Btw, the Dockerfile needs updating, as it copies a directory that doesn't exist anymore. |
To avoid having to commit the It can be done with the |
Got it. Once tried the approach of committing the |
5e42c36
to
b03d47b
Compare
6e4d655
to
0be9ffe
Compare
Since the tests fix is straightforward (by changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also update docs/development.md
? We should document the switch to sqlx
and perhaps also prepare some guide for developers how to setup Postgres, i.e. with a simple docker-compose.yml
file, and also the .env
file so that compilation even works. Thanks!
Do you think we should add a |
Yeah, I also thought that it might be a good idea, to make it simpler for potential contributors to get the codebase working. While we're at it, I would also add the |
65848d8
to
3aeb20c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good! I think that the only change left is to add a CI step that checks on CI that .sqlx
is updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This looks really great, thanks a lot for the hard work! I think that now the DB side is much cleaner, and makes it easier for us to understand exactly what queries we are running against the DB.
Haha, I have to admit, I was surprised that using raw sql string removed roughly 300 LOC from bors. BTW, is there something wrong with the CI checks? It keeps being queued and hasn't even started yet. |
Looks like some GHA bug (https://www.githubstatus.com/). The workflows have finished, but the status hasn't been updated yet. |
This is the first step to migrate from
sea-orm
tosqlx
. All sea-orm models have been removed. All interaction with the postgres database through raw sql string is defined in moduledatabase/operations
.The tests are expected to fail in this PR, because all those test share the same database connection. A new PR will be raised later to fix those tests by using
sqlx::test
, allowing each test to have its own database.