• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cljoly / rusqlite_migration
94%
master: 95%

Build:
Build:
LAST BUILD BRANCH: refactor-tests
DEFAULT BRANCH: master
Repo Added 18 Mar 2023 09:10AM UTC
Token pB6wRhQDsdC88inn2GVgCM6IKevWTVuLm regen
Build 891 Last
Files 5
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH migrations-to-apply
branch: migrations-to-apply
CHANGE BRANCH
x
Reset
Sync Branches
  • migrations-to-apply
  • 1.3.0-alpha
  • 1.3.1
  • 220
  • NOBLES5E/master
  • add-benchmarks
  • add-coveralls-badge
  • additional-async-tests
  • alpha-130-without-async
  • arc-async
  • async-pkg
  • back-ubuntu-latest
  • badges-update
  • borked-ci
  • bump
  • bump-test-coverage
  • bump-v110a2
  • cargo-locked
  • change-coverage-runner
  • changelog-1.0.2
  • changelog-update
  • changelog-update-20
  • changelog-update-20-alpha
  • ci-perms
  • cj/bump
  • cj/ci-speed-up
  • cj/display-m
  • cj/opt-in-val
  • cj/refactor-tests
  • cj/test-valid-ms
  • cleanup-ci
  • cleanup-tests
  • clement/force-run-ci
  • clippy-fixes
  • clippy-fixes-nov24
  • cljoly-codeowner
  • cljoly-patch-1
  • cljoly-typo
  • const-mirgrations-new
  • coverage
  • cow-lite
  • dependabot/cargo/anyhow-1.0.100
  • dependabot/cargo/anyhow-1.0.81
  • dependabot/cargo/anyhow-1.0.82
  • dependabot/cargo/anyhow-1.0.83
  • dependabot/cargo/anyhow-1.0.86
  • dependabot/cargo/anyhow-1.0.87
  • dependabot/cargo/anyhow-1.0.88
  • dependabot/cargo/anyhow-1.0.89
  • dependabot/cargo/anyhow-1.0.90
  • dependabot/cargo/anyhow-1.0.91
  • dependabot/cargo/anyhow-1.0.92
  • dependabot/cargo/anyhow-1.0.93
  • dependabot/cargo/anyhow-1.0.94
  • dependabot/cargo/anyhow-1.0.95
  • dependabot/cargo/anyhow-1.0.96
  • dependabot/cargo/anyhow-1.0.97
  • dependabot/cargo/anyhow-1.0.98
  • dependabot/cargo/anyhow-1.0.99
  • dependabot/cargo/criterion-0.5
  • dependabot/cargo/criterion-0.6.0
  • dependabot/cargo/criterion-0.7.0
  • dependabot/cargo/env_logger-0.11
  • dependabot/cargo/env_logger-0.11.1
  • dependabot/cargo/env_logger-0.11.5
  • dependabot/cargo/env_logger-0.11.6
  • dependabot/cargo/include_dir-0.7.4
  • dependabot/cargo/insta-1.37.0
  • dependabot/cargo/insta-1.38.0
  • dependabot/cargo/insta-1.39.0
  • dependabot/cargo/insta-1.40.0
  • dependabot/cargo/insta-1.41.0
  • dependabot/cargo/insta-1.41.1
  • dependabot/cargo/insta-1.43.0
  • dependabot/cargo/insta-1.43.1
  • dependabot/cargo/insta-1.43.2
  • dependabot/cargo/lazy_static-1.5.0
  • dependabot/cargo/log-0.4.21
  • dependabot/cargo/log-0.4.22
  • dependabot/cargo/log-0.4.25
  • dependabot/cargo/log-0.4.26
  • dependabot/cargo/log-0.4.27
  • dependabot/cargo/log-0.4.28
  • dependabot/cargo/mio-0.8.11
  • dependabot/cargo/rusqlite-0.32.1
  • dependabot/cargo/slab-0.4.11
  • dependabot/cargo/tokio-1.36.0
  • dependabot/cargo/tokio-1.37.0
  • dependabot/cargo/tokio-1.38.0
  • dependabot/cargo/tokio-1.38.1
  • dependabot/cargo/tokio-1.39.1
  • dependabot/cargo/tokio-1.39.2
  • dependabot/cargo/tokio-1.39.3
  • dependabot/cargo/tokio-1.40.0
  • dependabot/cargo/tokio-1.41.0
  • dependabot/cargo/tokio-1.41.1
  • dependabot/cargo/tokio-1.42.0
  • dependabot/cargo/tokio-1.43.0
  • dependabot/cargo/tokio-1.44.0
  • dependabot/cargo/tokio-1.44.1
  • dependabot/cargo/tokio-1.44.2
  • dependabot/cargo/tokio-1.45.0
  • dependabot/cargo/tokio-1.45.1
  • dependabot/cargo/tokio-1.46.0
  • dependabot/cargo/tokio-1.47.0
  • dependabot/cargo/tokio-1.47.1
  • dependabot/cargo/tokio-test-0.4.4
  • dependabot/cargo/zerocopy-0.7.32
  • deprecate-new_iter
  • deps-trimming
  • dir-no-leading-0
  • doc-badges
  • doc-fixes
  • doc-improvements
  • doc-readme-sync
  • doc-updates
  • docsrs-list-features
  • dont-pin-exact-rusqlite-version
  • down-foreign-key-check
  • eq-tests
  • error-tests
  • exp-readme
  • fix-and-shard-mutants
  • fix-ci
  • fix-ci-lint
  • fix-clippy-error
  • fix-deprecated-insta-macro
  • fix-deprs-shield
  • fix-docs
  • fix-lock
  • fix-readme-deps-badge
  • fix-source-mapping
  • fix-typo-feature-name
  • fix-typos
  • from-directory
  • handle-extra_check
  • ignore-artefacts
  • improved-edit-api
  • insta-doc
  • jolycl/1755207812
  • keep-api-compat-tests
  • license-notices
  • lite
  • manifest-fresh-paint
  • master
  • md-links
  • metadata-doc
  • misc-clean-up
  • misc-improvements
  • modernize-cargo-toml
  • more-tests
  • move-benchmarks
  • msrv
  • multi-errors-fkc
  • mutants-fixes
  • new-tokio-rusqlite
  • nightly-coverage
  • on-push
  • openssf
  • optimize-from_directory
  • out-of-bound-user-version
  • patch-1
  • pedantic-fixes
  • prep-without-tokio
  • pub-max_schema_version
  • readme-sourcehut
  • refactor-tests
  • refresh-cargo-toml
  • refs/pull/102/merge
  • refs/pull/103/merge
  • refs/pull/163/merge
  • refs/tags/v1.1.0
  • refs/tags/v1.1.0-alpha.2
  • refs/tags/v1.1.0-beta.1
  • refs/tags/v1.2.0
  • refs/tags/v1.2.0-beta.1
  • refs/tags/v1.3.0
  • refs/tags/v1.3.0-alpha-without-tokio.1
  • refs/tags/v1.3.0-beta.1
  • refs/tags/v1.3.1
  • refs/tags/v2.0.0
  • refs/tags/v2.0.0-alpha.1
  • refs/tags/v2.0.0-beta.1
  • refs/tags/v2.1.0
  • refs/tags/v2.2.0
  • refs/tags/v2.2.0-beta.1
  • refs/tags/v2.3.0
  • release-110-beta1
  • remove-async-iter2
  • remove-badge
  • remove-btreemap
  • remove-dead-code
  • remove-new-iter
  • rename-async-feature-to-alpha
  • require-new-rusqlite
  • rusqlite-033
  • rusqlite-036
  • rust-180
  • simpler-doc-generation
  • speed-up-mutants
  • test-duplication-fix
  • test-fmt
  • tweak-coverage
  • tweak-docs
  • update-actions
  • update-cargo-mutants
  • update-mutants-24.2
  • update-rusqlite
  • v1.1.0
  • version-120
  • version-120-beta1
  • version-130
  • version-130-beta-1
  • version-200
  • version-200-beta-1
  • version-200-beta-1-next
  • version-210

13 Apr 2025 01:05PM UTC coverage: 94.083% (+0.04%) from 94.048%
14429757190

Pull #248

github

cljoly
feat: expose the number of migrations to be applied

This is a slightly different take on #170, where instead of returning
the total number of migrations defined, we return the number of
migrations defined, but not yet applied.

Going back to the discussion in #170, what we actually need is:
1. tell whether migrations will be run, without actually running them.
   One use of this information is to run a backups before applying the
   migrations.
2. [“see the version difference somehow”][diff], i.e. the number of
   migrations to be applied.

Thus I think that returning the number of migrations to be applied,
instead of the number of migrations already applied fulfills the need
better. And it is less of a foot gun in my opinion:
1. The index in the vector of migration is off by one compared to the
   index in the user version, which is the one exposed by
   [`to_version()`][to_version] effectively. In other words, the first
   migration in the array is index 0, but that’s effectively version 1.
2. As discussed in #170, users might be tempted to write something like:
   ```rust
   if migrations.needs_to_run() {
     migrations.to_latest()
   }
   ```
   which would be suboptimal, as `to_latest` performs the same check.

Closes https://github.com/cljoly/rusqlite_migration/issues/170

[to_version]: https://docs.rs/rusqlite_migration/1.3.1/rusqlite_migration/struct.AsyncMigrations.html#example-4
[difference]: https://github.com/cljoly/rusqlite_migration/issues/170#issuecomment-2343979134

Builds-on: https://github.com/cljoly/rusqlite_migration/pull/171
Co-authored-by: Alex Helfet <alex.helfet@gmail.com>
Pull Request #248: feat: expose the number of migrations to be applied

2 of 2 new or added lines in 1 file covered. (100.0%)

318 of 338 relevant lines covered (94.08%)

5.69 hits per line

Relevant lines Covered
Build:
Build:
338 RELEVANT LINES 318 COVERED LINES
5.69 HITS PER LINE
Source Files on migrations-to-apply
  • Tree
  • List 5
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
14429757190 migrations-to-apply feat: expose the number of migrations to be applied This is a slightly different take on #170, where instead of returning the total number of migrations defined, we return the number of migrations defined, but not yet applied. Going back to the ... Pull #248 13 Apr 2025 01:06PM UTC cljoly github
94.08
14428512152 migrations-to-apply feat: expose the number of migrations to be applied This is a slightly different take on #170, where instead of returning the total number of migrations defined, we return the number of migrations defined, but not yet applied. Going back to the ... Pull #248 13 Apr 2025 10:15AM UTC cljoly github
94.08
14391348666 migrations-to-apply feat: expose the number of migrations to be applied This is a slightly different take on #170, where instead of returning the total number of migrations defined, we return the number of migrations defined, but not yet applied. Going back to the ... Pull #248 10 Apr 2025 10:18PM UTC cljoly github
94.08
14368033128 migrations-to-apply feat: expose the number of migrations to be applied This is a slightly different take on #170, where instead of returning the total number of migrations defined, we return the number of migrations defined, but not yet applied. Going back to the ... Pull #248 09 Apr 2025 10:20PM UTC cljoly github
94.03
14368016206 migrations-to-apply feat: expose the number of migrations to be applied This is a slightly different take on #170, where instead of returning the total number of migrations defined, we return the number of migrations defined, but not yet applied. Going back to the ... push 09 Apr 2025 10:19PM UTC cljoly github
94.03
14048488454 migrations-to-apply feat: expose the number of migrations to be applied This is a slightly different take on #170, where instead of returning the total number of migrations defined, we return the number of migrations defined, but not yet applied. Going back to the ... Pull #248 25 Mar 2025 12:06AM UTC cljoly github
94.03
14024015853 migrations-to-apply WIP migrations_to_apply push 23 Mar 2025 11:22PM UTC cljoly github
93.43
14023743233 migrations-to-apply WIP migrations_to_apply push 23 Mar 2025 10:46PM UTC cljoly github
93.43
14023079257 migrations-to-apply WIP migrations_to_apply push 23 Mar 2025 09:18PM UTC cljoly github
92.63
14021340861 migrations-to-apply WIP migrations_to_apply push 23 Mar 2025 05:32PM UTC cljoly github
92.63
See All Builds (635)

Badge your Repo: rusqlite_migration

We detected this repo isn’t badged! Grab the embed code to the right, add it to your repo to show off your code coverage, and when the badge is live hit the refresh button to remove this message.

Could not find badge in README.

Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

Refresh
  • Settings
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc