Skip to content

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

Merged
rubenfiszel merged 6 commits into
windmill-labs:mainfrom
mrl5:upgrade-sqlx
Jul 15, 2023
Merged

rubenfiszel merged 6 commits into
windmill-labs:mainfrom
mrl5:upgrade-sqlx

Conversation

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

mrl5 commented Jul 12, 2023 •

Copy link
Copy Markdown
Contributor Author

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
Comment thread backend/Cargo.toml Resolved
@mrl5
mrl5 marked this pull request as ready for review July 15, 2023 05:44
Comment thread README.md
`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

@mrl5 mrl5 Jul 15, 2023 •

Copy link
Copy Markdown
Contributor Author

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

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants