-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Store offline data in one file per query / remove sqlx-data.json #941
Conversation
4529492
to
8e15d56
Compare
2e28295
to
f1d7770
Compare
@mehcode @abonader it would be nice if one of you could do an initial review now, to find any issues with the general approach I took early. There are TODO comments for everything that's not done yet. The only thing I'm not sure about is how support for workspaces with multiple crates using SQLx'es offline feature should work. I think it makes sense for there not to be one merged |
f1d7770
to
7979cad
Compare
7979cad
to
d2a809f
Compare
by doing all .env and environment variable reading inside a Lazy initializer.
ba643dc
to
9a02f56
Compare
Query data is now stored in .sqlx/{query_hash}.json directly by the macro invocations, rather than first writing to target/sqlx/{input_span_hash}.json and then collecting those into sqlx-data.json separately.
9a02f56
to
2ad1ed8
Compare
@jplatte What's left here? Is it just the bikeshedding over where we output the query data files? |
No, I still need to get back to this and finish the implementation. I think all open questions were resolved. See the PR description for what's left to do. |
I think you'd still need a separate program to go through and remove stale query data to keep the folder size from growing indefinitely. Perhaps we could do something with build scripts where we put all the boilerplate in a function that the user can call in a single line, e.g. fn main() {
sqlx::build_script().unwrap();
} which would:
|
I know the branch name says |
Huh, so even if a branch rename happens through GitHubs web UI, corresponding PRs are just closed. That's stupid... |
I wanted to re-open after renaming the branch back, but apparently that's not possible either. New PR is up: #1183. |
Query data is now stored in .sqlx/{query_hash}.json directly by the macro invocations, rather than first writing to target/sqlx/{input_span_hash}.json and then collecting those into sqlx-data.json separately.
.sqlx
exists).sqlx
when runningcargo sqlx prepare
target/sqlx
with.sqlx
incargo sqlx prepare --check
Closes #570.