-
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
docs: Acquire examples and alternative #1687
Conversation
c085bfe
to
84eb59d
Compare
@stoically looks like your examples aren't compiling in CI: https://github.com/launchbadge/sqlx/runs/5211089701?check_suite_focus=true |
8da1b79
to
b59326e
Compare
@abonander Yeah, since every workflow run needs another approval, debugging takes a while. First reason it failed CI was missing postgres feature. Now it doesn't have a |
88043c2
to
26b1f42
Compare
I don't like the requirement of a Postgres database for unit testing. Kinda defeats the purpose of having a separate pass just for unit tests. Coincidentally, however, I did just add a way for tests to know if they're meant only for (a certain version of) Postgres, which could be useful here. Try removing the changes you made to #[cfg(any(postgres_9_6, postgres_14))] |
a5d8d3b
to
ef8c70d
Compare
While I agree that unit tests should have no external dependencies, I'd argue that doc tests are (or should be) feature/integration tests, not unit tests. Since they are executed from the same point of view than integration tests, where they have to explicitly
Sounds good, adjusted accordingly. |
ef8c70d
to
71e22ce
Compare
71e22ce
to
a9d22ed
Compare
I'm not arguing there, I agree. The context of my comment was your modifications to the "Unit Test" pass of CI. I think technically we could restrict that pass to just unit tests without having |
Seems like |
Yeah, this seems to work fine though so we'll probably just go with it. |
Tried to summarize my findings around
Acquire
fromAcquire
more than once not possible because of lifetimes #1635Acquire
lifetime errors in axum handlers #1686sqlx::Acquire
is not general enough for MySqlConnection #1015 (comment)as doc examples so others might have an easier start.