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

chore(backend): upgrade sqlx to ^0.7 #1865

Merged
merged 6 commits into from
Jul 15, 2023
Merged

Conversation

@mrl5 mrl5 requested a review from rubenfiszel as a code owner July 12, 2023 08:30
@mrl5
Copy link
Contributor Author

mrl5 commented Jul 12, 2023

how it was tested

diff --git a/docker-compose.yml b/docker-compose.yml
index 7c01c244..88ca7669 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -9,8 +9,8 @@ services:
     restart: unless-stopped
     volumes:
       - db_data:/var/lib/postgresql/data
-    expose:
-      - 5432
+    ports:
+      - 5432:5432
     environment:
       POSTGRES_PASSWORD: ${DB_PASSWORD}
       POSTGRES_DB: windmill
docker compose up db
cargo install --version ^0.7 sqlx-cli
export DATABASE_URL=postgres://postgres:changeme@localhost/windmill?sslmode=disable
cd ./backend
sqlx migrate run 
cd ../frontend
npm ci
npm run generate-backend-client
npm run build
cd ../backend

# just in case
cargo sqlx prepare --workspace -- --all-features

# as per backend/README.md
cargo sqlx prepare --workspace -- --bin windmill --features enterprise
cargo run 

@mrl5

This comment was marked as resolved.

@mrl5 mrl5 marked this pull request as draft July 12, 2023 08:36
@mrl5 mrl5 changed the title DRAFT chore(backend): upgrade sqlx to ^0.7 chore(backend): upgrade sqlx to ^0.7 Jul 12, 2023
@mrl5 mrl5 marked this pull request as ready for review July 15, 2023 05:44
`cargo install sqlx-cli && sqlx migrate run`. This will also avoid compile
time issue with sqlx's `query!` macro
Postgres setup. The easiest way to get a working postgres is running `cargo
install --version ^0.7 sqlx-cli && sqlx migrate run`. This will also avoid
Copy link
Contributor Author

@mrl5 mrl5 Jul 15, 2023

Choose a reason for hiding this comment

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

⚠️
@rubenfiszel using sqlx-cli version (in terminal) that's in sync with sqlx version (in windmills Cargo.lock) is probably the most important take away for this PR.

On the other hand I think above is only relevant for contributors that need to run this

### Compile sqlx for offline ci
```
cargo sqlx prepare --merged -- --bin windmill --features enterprise
```

@rubenfiszel rubenfiszel merged commit 72d0d8a into windmill-labs:main Jul 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants